| Index: ppapi/cpp/network_list.cc
|
| diff --git a/ppapi/cpp/private/network_list_private.cc b/ppapi/cpp/network_list.cc
|
| similarity index 40%
|
| rename from ppapi/cpp/private/network_list_private.cc
|
| rename to ppapi/cpp/network_list.cc
|
| index 5a3a5be3d014f13502f6150e717df9d51c88cf46..12c3bf4c96ce91f45070b3a0b3d4854a36698aba 100644
|
| --- a/ppapi/cpp/private/network_list_private.cc
|
| +++ b/ppapi/cpp/network_list.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ppapi/cpp/private/network_list_private.h"
|
| +#include "ppapi/cpp/network_list.h"
|
|
|
| #include "ppapi/c/pp_errors.h"
|
| #include "ppapi/cpp/array_output.h"
|
| @@ -15,79 +15,79 @@ namespace pp {
|
|
|
| namespace {
|
|
|
| -template <> const char* interface_name<PPB_NetworkList_Private_0_3>() {
|
| - return PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3;
|
| +template <> const char* interface_name<PPB_NetworkList_1_0>() {
|
| + return PPB_NETWORKLIST_INTERFACE_1_0;
|
| }
|
|
|
| } // namespace
|
|
|
| -NetworkListPrivate::NetworkListPrivate() {
|
| +NetworkList::NetworkList() {
|
| }
|
|
|
| -NetworkListPrivate::NetworkListPrivate(PassRef, PP_Resource resource)
|
| +NetworkList::NetworkList(PassRef, PP_Resource resource)
|
| : Resource(PASS_REF, resource) {
|
| }
|
|
|
| // static
|
| -bool NetworkListPrivate::IsAvailable() {
|
| - return has_interface<PPB_NetworkList_Private_0_3>();
|
| +bool NetworkList::IsAvailable() {
|
| + return has_interface<PPB_NetworkList_1_0>();
|
| }
|
|
|
| -uint32_t NetworkListPrivate::GetCount() const {
|
| - if (!has_interface<PPB_NetworkList_Private_0_3>())
|
| +uint32_t NetworkList::GetCount() const {
|
| + if (!has_interface<PPB_NetworkList_1_0>())
|
| return 0;
|
| - return get_interface<PPB_NetworkList_Private_0_3>()->GetCount(pp_resource());
|
| + return get_interface<PPB_NetworkList_1_0>()->GetCount(pp_resource());
|
| }
|
|
|
| -std::string NetworkListPrivate::GetName(uint32_t index) const {
|
| - if (!has_interface<PPB_NetworkList_Private_0_3>())
|
| +std::string NetworkList::GetName(uint32_t index) const {
|
| + if (!has_interface<PPB_NetworkList_1_0>())
|
| return std::string();
|
| Var result(PASS_REF,
|
| - get_interface<PPB_NetworkList_Private_0_3>()->GetName(
|
| + get_interface<PPB_NetworkList_1_0>()->GetName(
|
| pp_resource(), index));
|
| return result.is_string() ? result.AsString() : std::string();
|
| }
|
|
|
| -PP_NetworkListType_Private NetworkListPrivate::GetType(uint32_t index) const {
|
| - if (!has_interface<PPB_NetworkList_Private_0_3>())
|
| - return PP_NETWORKLIST_ETHERNET;
|
| - return get_interface<PPB_NetworkList_Private_0_3>()->GetType(
|
| +PP_NetworkList_Type NetworkList::GetType(uint32_t index) const {
|
| + if (!has_interface<PPB_NetworkList_1_0>())
|
| + return PP_NETWORKLIST_TYPE_ETHERNET;
|
| + return get_interface<PPB_NetworkList_1_0>()->GetType(
|
| pp_resource(), index);
|
| }
|
|
|
| -PP_NetworkListState_Private NetworkListPrivate::GetState(uint32_t index) const {
|
| - if (!has_interface<PPB_NetworkList_Private_0_3>())
|
| - return PP_NETWORKLIST_DOWN;
|
| - return get_interface<PPB_NetworkList_Private_0_3>()->GetState(
|
| +PP_NetworkList_State NetworkList::GetState(uint32_t index) const {
|
| + if (!has_interface<PPB_NetworkList_1_0>())
|
| + return PP_NETWORKLIST_STATE_DOWN;
|
| + return get_interface<PPB_NetworkList_1_0>()->GetState(
|
| pp_resource(), index);
|
| }
|
|
|
| -int32_t NetworkListPrivate::GetIpAddresses(
|
| +int32_t NetworkList::GetIpAddresses(
|
| uint32_t index,
|
| std::vector<NetAddress>* addresses) const {
|
| - if (!has_interface<PPB_NetworkList_Private_0_3>())
|
| + if (!has_interface<PPB_NetworkList_1_0>())
|
| return PP_ERROR_NOINTERFACE;
|
| if (!addresses)
|
| return PP_ERROR_BADARGUMENT;
|
|
|
| ResourceArrayOutputAdapter<NetAddress> adapter(addresses);
|
| - return get_interface<PPB_NetworkList_Private_0_3>()->GetIpAddresses(
|
| + return get_interface<PPB_NetworkList_1_0>()->GetIpAddresses(
|
| pp_resource(), index, adapter.pp_array_output());
|
| }
|
|
|
| -std::string NetworkListPrivate::GetDisplayName(uint32_t index) const {
|
| - if (!has_interface<PPB_NetworkList_Private_0_3>())
|
| +std::string NetworkList::GetDisplayName(uint32_t index) const {
|
| + if (!has_interface<PPB_NetworkList_1_0>())
|
| return std::string();
|
| Var result(PASS_REF,
|
| - get_interface<PPB_NetworkList_Private_0_3>()->GetDisplayName(
|
| + get_interface<PPB_NetworkList_1_0>()->GetDisplayName(
|
| pp_resource(), index));
|
| return result.is_string() ? result.AsString() : std::string();
|
| }
|
|
|
| -uint32_t NetworkListPrivate::GetMTU(uint32_t index) const {
|
| - if (!has_interface<PPB_NetworkList_Private_0_3>())
|
| +uint32_t NetworkList::GetMTU(uint32_t index) const {
|
| + if (!has_interface<PPB_NetworkList_1_0>())
|
| return 0;
|
| - return get_interface<PPB_NetworkList_Private_0_3>()->GetMTU(
|
| + return get_interface<PPB_NetworkList_1_0>()->GetMTU(
|
| pp_resource(), index);
|
| }
|
|
|
|
|