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

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

Powered by Google App Engine
This is Rietveld 408576698