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

Side by Side Diff: ppapi/cpp/private/network_list_private.cc

Issue 10381002: Pepper: Make users of pp:NetworkMonitorPrivate less likely to leak resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: doh Created 8 years, 7 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/cpp/private/network_list_private.h ('k') | ppapi/tests/test_network_monitor_private.cc » ('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 #include "ppapi/cpp/private/network_list_private.h" 5 #include "ppapi/cpp/private/network_list_private.h"
6 6
7 #include "ppapi/cpp/module_impl.h" 7 #include "ppapi/cpp/module_impl.h"
8 #include "ppapi/cpp/var.h" 8 #include "ppapi/cpp/var.h"
9 9
10 namespace pp { 10 namespace pp {
11 11
12 namespace { 12 namespace {
13 13
14 template <> const char* interface_name<PPB_NetworkList_Private>() { 14 template <> const char* interface_name<PPB_NetworkList_Private>() {
15 return PPB_NETWORKLIST_PRIVATE_INTERFACE; 15 return PPB_NETWORKLIST_PRIVATE_INTERFACE;
16 } 16 }
17 17
18 } // namespace 18 } // namespace
19 19
20 NetworkListPrivate::NetworkListPrivate() { 20 NetworkListPrivate::NetworkListPrivate() {
21 } 21 }
22 22
23 NetworkListPrivate::NetworkListPrivate(PP_Resource resource) 23 NetworkListPrivate::NetworkListPrivate(PassRef, PP_Resource resource)
24 : Resource(resource) { 24 : Resource(PASS_REF, resource) {
25 } 25 }
26 26
27 // static 27 // static
28 bool NetworkListPrivate::IsAvailable() { 28 bool NetworkListPrivate::IsAvailable() {
29 return has_interface<PPB_NetworkList_Private>(); 29 return has_interface<PPB_NetworkList_Private>();
30 } 30 }
31 31
32 uint32_t NetworkListPrivate::GetCount() const { 32 uint32_t NetworkListPrivate::GetCount() const {
33 if (!has_interface<PPB_NetworkList_Private>()) 33 if (!has_interface<PPB_NetworkList_Private>())
34 return 0; 34 return 0;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 uint32_t NetworkListPrivate::GetMTU(uint32_t index) const { 103 uint32_t NetworkListPrivate::GetMTU(uint32_t index) const {
104 if (!has_interface<PPB_NetworkList_Private>()) 104 if (!has_interface<PPB_NetworkList_Private>())
105 return 0; 105 return 0;
106 return get_interface<PPB_NetworkList_Private>()->GetMTU( 106 return get_interface<PPB_NetworkList_Private>()->GetMTU(
107 pp_resource(), index); 107 pp_resource(), index);
108 } 108 }
109 109
110 } // namespace pp 110 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/private/network_list_private.h ('k') | ppapi/tests/test_network_monitor_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698