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

Side by Side Diff: ppapi/cpp/network_monitor.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
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 #include "ppapi/cpp/private/network_monitor_private.h" 5 #include "ppapi/cpp/network_monitor.h"
6 6
7 #include "ppapi/c/private/ppb_network_monitor_private.h" 7 #include "ppapi/c/ppb_network_monitor.h"
8 #include "ppapi/cpp/completion_callback.h" 8 #include "ppapi/cpp/completion_callback.h"
9 #include "ppapi/cpp/instance.h" 9 #include "ppapi/cpp/instance.h"
10 #include "ppapi/cpp/module_impl.h" 10 #include "ppapi/cpp/module_impl.h"
11 #include "ppapi/cpp/private/network_list_private.h" 11 #include "ppapi/cpp/network_list.h"
12 12
13 namespace pp { 13 namespace pp {
14 14
15 namespace { 15 namespace {
16 16
17 template <> const char* interface_name<PPB_NetworkMonitor_Private_0_3>() { 17 template <> const char* interface_name<PPB_NetworkMonitor_1_0>() {
18 return PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3; 18 return PPB_NETWORKMONITOR_INTERFACE_1_0;
19 } 19 }
20 20
21 } // namespace 21 } // namespace
22 22
23 NetworkMonitorPrivate::NetworkMonitorPrivate(const InstanceHandle& instance) { 23 NetworkMonitor::NetworkMonitor(const InstanceHandle& instance) {
24 if (has_interface<PPB_NetworkMonitor_Private_0_3>()) { 24 if (has_interface<PPB_NetworkMonitor_1_0>()) {
25 PassRefFromConstructor(get_interface<PPB_NetworkMonitor_Private_0_3>()-> 25 PassRefFromConstructor(get_interface<PPB_NetworkMonitor_1_0>()->Create(
26 Create(instance.pp_instance())); 26 instance.pp_instance()));
27 } 27 }
28 } 28 }
29 29
30 int32_t NetworkMonitorPrivate::UpdateNetworkList( 30 int32_t NetworkMonitor::UpdateNetworkList(
31 const CompletionCallbackWithOutput<NetworkListPrivate>& callback) { 31 const CompletionCallbackWithOutput<NetworkList>& callback) {
32 if (has_interface<PPB_NetworkMonitor_Private_0_3>()) { 32 if (has_interface<PPB_NetworkMonitor_1_0>()) {
33 return get_interface<PPB_NetworkMonitor_Private_0_3>()->UpdateNetworkList( 33 return get_interface<PPB_NetworkMonitor_1_0>()->UpdateNetworkList(
34 pp_resource(), callback.output(), callback.pp_completion_callback()); 34 pp_resource(), callback.output(), callback.pp_completion_callback());
35 } 35 }
36 return callback.MayForce(PP_ERROR_NOINTERFACE); 36 return callback.MayForce(PP_ERROR_NOINTERFACE);
37 } 37 }
38 38
39 // static 39 // static
40 bool NetworkMonitorPrivate::IsAvailable() { 40 bool NetworkMonitor::IsAvailable() {
41 return has_interface<PPB_NetworkMonitor_Private_0_3>(); 41 return has_interface<PPB_NetworkMonitor_1_0>();
42 } 42 }
43 43
44 } // namespace pp 44 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698