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

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

Issue 23450012: Make NetworkList and NetworkMonitor APIs public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months 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/ppb_network_monitor_private_thunk.cc ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // From private/ppb_network_monitor_private.idl, 5 // From ppb_network_monitor.idl modified Thu Sep 5 12:10:00 2013.
6 // modified Wed Sep 4 14:16:07 2013.
7 6
8 #include "ppapi/c/pp_completion_callback.h" 7 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/private/ppb_network_monitor_private.h" 9 #include "ppapi/c/ppb_network_monitor.h"
11 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
12 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
13 #include "ppapi/thunk/ppb_instance_api.h" 12 #include "ppapi/thunk/ppb_instance_api.h"
14 #include "ppapi/thunk/ppb_network_monitor_api.h" 13 #include "ppapi/thunk/ppb_network_monitor_api.h"
15 #include "ppapi/thunk/resource_creation_api.h" 14 #include "ppapi/thunk/resource_creation_api.h"
16 #include "ppapi/thunk/thunk.h" 15 #include "ppapi/thunk/thunk.h"
17 16
18 namespace ppapi { 17 namespace ppapi {
19 namespace thunk { 18 namespace thunk {
20 19
21 namespace { 20 namespace {
22 21
23 PP_Resource Create(PP_Instance instance) { 22 PP_Resource Create(PP_Instance instance) {
24 VLOG(4) << "PPB_NetworkMonitor_Private::Create()"; 23 VLOG(4) << "PPB_NetworkMonitor::Create()";
25 EnterResourceCreation enter(instance); 24 EnterResourceCreation enter(instance);
26 if (enter.failed()) 25 if (enter.failed())
27 return 0; 26 return 0;
28 return enter.functions()->CreateNetworkMonitorPrivate(instance); 27 return enter.functions()->CreateNetworkMonitor(instance);
29 } 28 }
30 29
31 int32_t UpdateNetworkList(PP_Resource network_monitor, 30 int32_t UpdateNetworkList(PP_Resource network_monitor,
32 PP_Resource* network_list, 31 PP_Resource* network_list,
33 struct PP_CompletionCallback callback) { 32 struct PP_CompletionCallback callback) {
34 VLOG(4) << "PPB_NetworkMonitor_Private::UpdateNetworkList()"; 33 VLOG(4) << "PPB_NetworkMonitor::UpdateNetworkList()";
35 EnterResource<PPB_NetworkMonitor_API> enter(network_monitor, callback, true); 34 EnterResource<PPB_NetworkMonitor_API> enter(network_monitor, callback, true);
36 if (enter.failed()) 35 if (enter.failed())
37 return enter.retval(); 36 return enter.retval();
38 return enter.SetResult(enter.object()->UpdateNetworkList(network_list, 37 return enter.SetResult(enter.object()->UpdateNetworkList(network_list,
39 enter.callback())); 38 enter.callback()));
40 } 39 }
41 40
42 PP_Bool IsNetworkMonitor(PP_Resource resource) { 41 PP_Bool IsNetworkMonitor(PP_Resource resource) {
43 VLOG(4) << "PPB_NetworkMonitor_Private::IsNetworkMonitor()"; 42 VLOG(4) << "PPB_NetworkMonitor::IsNetworkMonitor()";
44 EnterResource<PPB_NetworkMonitor_API> enter(resource, false); 43 EnterResource<PPB_NetworkMonitor_API> enter(resource, false);
45 return PP_FromBool(enter.succeeded()); 44 return PP_FromBool(enter.succeeded());
46 } 45 }
47 46
48 const PPB_NetworkMonitor_Private_0_3 g_ppb_networkmonitor_private_thunk_0_3 = { 47 const PPB_NetworkMonitor_1_0 g_ppb_networkmonitor_thunk_1_0 = {
49 &Create, 48 &Create,
50 &UpdateNetworkList, 49 &UpdateNetworkList,
51 &IsNetworkMonitor 50 &IsNetworkMonitor
52 }; 51 };
53 52
54 } // namespace 53 } // namespace
55 54
56 const PPB_NetworkMonitor_Private_0_3* 55 const PPB_NetworkMonitor_1_0* GetPPB_NetworkMonitor_1_0_Thunk() {
57 GetPPB_NetworkMonitor_Private_0_3_Thunk() { 56 return &g_ppb_networkmonitor_thunk_1_0;
58 return &g_ppb_networkmonitor_private_thunk_0_3;
59 } 57 }
60 58
61 } // namespace thunk 59 } // namespace thunk
62 } // namespace ppapi 60 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_network_monitor_private_thunk.cc ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698