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

Side by Side Diff: ppapi/thunk/ppb_network_monitor_private_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_api.h ('k') | ppapi/thunk/ppb_network_monitor_thunk.cc » ('j') | 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) 2012 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 // From private/ppb_network_monitor_private.idl,
6 // modified Wed Sep 4 14:16:07 2013.
7
8 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/private/ppb_network_monitor_private.h"
11 #include "ppapi/shared_impl/tracked_callback.h"
12 #include "ppapi/thunk/enter.h"
13 #include "ppapi/thunk/ppb_instance_api.h"
14 #include "ppapi/thunk/ppb_network_monitor_api.h"
15 #include "ppapi/thunk/resource_creation_api.h"
16 #include "ppapi/thunk/thunk.h"
17
18 namespace ppapi {
19 namespace thunk {
20
21 namespace {
22
23 PP_Resource Create(PP_Instance instance) {
24 VLOG(4) << "PPB_NetworkMonitor_Private::Create()";
25 EnterResourceCreation enter(instance);
26 if (enter.failed())
27 return 0;
28 return enter.functions()->CreateNetworkMonitorPrivate(instance);
29 }
30
31 int32_t UpdateNetworkList(PP_Resource network_monitor,
32 PP_Resource* network_list,
33 struct PP_CompletionCallback callback) {
34 VLOG(4) << "PPB_NetworkMonitor_Private::UpdateNetworkList()";
35 EnterResource<PPB_NetworkMonitor_API> enter(network_monitor, callback, true);
36 if (enter.failed())
37 return enter.retval();
38 return enter.SetResult(enter.object()->UpdateNetworkList(network_list,
39 enter.callback()));
40 }
41
42 PP_Bool IsNetworkMonitor(PP_Resource resource) {
43 VLOG(4) << "PPB_NetworkMonitor_Private::IsNetworkMonitor()";
44 EnterResource<PPB_NetworkMonitor_API> enter(resource, false);
45 return PP_FromBool(enter.succeeded());
46 }
47
48 const PPB_NetworkMonitor_Private_0_3 g_ppb_networkmonitor_private_thunk_0_3 = {
49 &Create,
50 &UpdateNetworkList,
51 &IsNetworkMonitor
52 };
53
54 } // namespace
55
56 const PPB_NetworkMonitor_Private_0_3*
57 GetPPB_NetworkMonitor_Private_0_3_Thunk() {
58 return &g_ppb_networkmonitor_private_thunk_0_3;
59 }
60
61 } // namespace thunk
62 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_network_monitor_api.h ('k') | ppapi/thunk/ppb_network_monitor_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698