Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: ppapi/thunk/ppb_ext_alarms_thunk.cc

Issue 103093004: Remove PPB_Ext_Alarms_Dev and PPB_Ext_Events_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/interfaces_ppb_public_dev.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #include <vector>
6
7 #include "ppapi/c/extensions/dev/ppb_ext_alarms_dev.h"
8 #include "ppapi/shared_impl/tracked_callback.h"
9 #include "ppapi/thunk/enter.h"
10 #include "ppapi/thunk/extensions_common_api.h"
11 #include "ppapi/thunk/thunk.h"
12
13 namespace ppapi {
14 namespace thunk {
15
16 namespace {
17
18 void Create(PP_Instance instance,
19 PP_Var name,
20 PP_Ext_Alarms_AlarmCreateInfo_Dev alarm_info) {
21 EnterInstanceAPI<ExtensionsCommon_API> enter(instance);
22 if (enter.failed())
23 return;
24
25 std::vector<PP_Var> args;
26 args.push_back(name);
27 args.push_back(alarm_info);
28 enter.functions()->PostRenderer("alarms.create", args);
29 }
30
31 int32_t Get(PP_Instance instance,
32 PP_Var name,
33 PP_Ext_Alarms_Alarm_Dev* alarm,
34 PP_CompletionCallback callback) {
35 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback);
36 if (enter.failed())
37 return enter.retval();
38
39 std::vector<PP_Var> input_args;
40 std::vector<PP_Var*> output_args;
41 input_args.push_back(name);
42 output_args.push_back(alarm);
43 return enter.SetResult(enter.functions()->CallRenderer(
44 "alarms.get", input_args, output_args, enter.callback()));
45 }
46
47 int32_t GetAll(PP_Instance instance,
48 PP_Ext_Alarms_Alarm_Dev_Array* alarms,
49 PP_CompletionCallback callback) {
50 EnterInstanceAPI<ExtensionsCommon_API> enter(instance, callback);
51 if (enter.failed())
52 return enter.retval();
53
54 std::vector<PP_Var> input_args;
55 std::vector<PP_Var*> output_args;
56 output_args.push_back(alarms);
57 return enter.SetResult(enter.functions()->CallRenderer(
58 "alarms.getAll", input_args, output_args, enter.callback()));
59 }
60
61 void Clear(PP_Instance instance, PP_Var name) {
62 EnterInstanceAPI<ExtensionsCommon_API> enter(instance);
63 if (enter.failed())
64 return;
65
66 std::vector<PP_Var> args;
67 args.push_back(name);
68 enter.functions()->PostRenderer("alarms.clear", args);
69 }
70
71 void ClearAll(PP_Instance instance) {
72 EnterInstanceAPI<ExtensionsCommon_API> enter(instance);
73 if (enter.failed())
74 return;
75
76 std::vector<PP_Var> args;
77 enter.functions()->PostRenderer("alarms.clearAll", args);
78 }
79
80 const PPB_Ext_Alarms_Dev_0_1 g_ppb_ext_alarms_dev_0_1_thunk = {
81 &Create,
82 &Get,
83 &GetAll,
84 &Clear,
85 &ClearAll
86 };
87
88 } // namespace
89
90 const PPB_Ext_Alarms_Dev_0_1* GetPPB_Ext_Alarms_Dev_0_1_Thunk() {
91 return &g_ppb_ext_alarms_dev_0_1_thunk;
92 }
93
94 } // namespace thunk
95 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/interfaces_ppb_public_dev.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698