| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |