1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/logging.h"
6 #include "ppapi/c/dev/ppb_alarms_dev.h"
7 #include "ppapi/shared_impl/tracked_callback.h"
8 #include "ppapi/thunk/enter.h"
9 #include "ppapi/thunk/extensions_common_api.h"
10 #include "ppapi/thunk/thunk.h"
17 // TODO(yzshen): crbug.com/327197 Implement the thunk.
19 void Create(PP_Instance instance
,
21 const PP_Alarms_AlarmCreateInfo_Dev
* alarm_info
) {
25 int32_t Get(PP_Instance instance
,
27 PP_Alarms_Alarm_Dev
* alarm
,
28 PP_CompletionCallback callback
) {
29 EnterInstanceAPI
<ExtensionsCommon_API
> enter(instance
, callback
);
31 return enter
.retval();
35 return enter
.SetResult(PP_ERROR_FAILED
);
38 int32_t GetAll(PP_Instance instance
,
39 PP_Alarms_Alarm_Array_Dev
* alarms
,
40 PP_ArrayOutput array_allocator
,
41 PP_CompletionCallback callback
) {
42 EnterInstanceAPI
<ExtensionsCommon_API
> enter(instance
, callback
);
44 return enter
.retval();
48 return enter
.SetResult(PP_ERROR_FAILED
);
51 void Clear(PP_Instance instance
, PP_Var name
) {
55 void ClearAll(PP_Instance instance
) {
59 uint32_t AddOnAlarmListener(PP_Instance instance
,
60 PP_Alarms_OnAlarm_Dev callback
,
66 const PPB_Alarms_Dev_0_1 g_ppb_alarms_dev_0_1_thunk
= {
77 const PPB_Alarms_Dev_0_1
* GetPPB_Alarms_Dev_0_1_Thunk() {
78 return &g_ppb_alarms_dev_0_1_thunk
;