diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-03 01:20:37 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-03 01:20:37 +0000 |
commit | d7a36f980fd5857c912f219c4897bf7677762123 (patch) | |
tree | 82cdd7aa2282beacf6c64ef791c93cbee9af605e /ppapi | |
parent | a4605c5a23b4d2fc5f15b8ab40293b6ecf223ea6 (diff) | |
download | chromium_src-d7a36f980fd5857c912f219c4897bf7677762123.zip chromium_src-d7a36f980fd5857c912f219c4897bf7677762123.tar.gz chromium_src-d7a36f980fd5857c912f219c4897bf7677762123.tar.bz2 |
Revert 124797 - Add NetworkList/NetworkMonitor hooks and C++ wrappers.
BUG=114808
Review URL: http://codereview.chromium.org/9545010
TBR=sergeyu@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9585033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124809 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
20 files changed, 17 insertions, 645 deletions
diff --git a/ppapi/api/private/ppb_network_list_private.idl b/ppapi/api/private/ppb_network_list_private.idl index 540aa1d..00c8a0f 100644 --- a/ppapi/api/private/ppb_network_list_private.idl +++ b/ppapi/api/private/ppb_network_list_private.idl @@ -17,24 +17,19 @@ label Chrome { [assert_size(4)] enum PP_NetworkListType_Private { /** - * Type of the network interface is not known. - */ - PP_NETWORKLIST_UNKNOWN = 0, - - /** * Wired Ethernet network. */ - PP_NETWORKLIST_ETHERNET = 1, + PP_NETWORKLIST_ETHERNET = 0, /** * Wireless Wi-Fi network. */ - PP_NETWORKLIST_WIFI = 2, + PP_NETWORKLIST_WIFI = 1, /** * Cellular network (e.g. LTE). */ - PP_NETWORKLIST_CELLULAR = 3 + PP_NETWORKLIST_CELLULAR = 2 }; /** @@ -90,15 +85,15 @@ interface PPB_NetworkList_Private { * @return Returns type of the network interface with the specified * <code>index</code>. */ - PP_NetworkListType_Private GetType([in] PP_Resource resource, - [in] uint32_t index); + PP_NetworkListType_Private GetType([in] PP_Resource resource, + [in] uint32_t index); /** * @return Returns current state of the network interface with the * specified <code>index</code>. */ - PP_NetworkListState_Private GetState([in] PP_Resource resource, - [in] uint32_t index); + PP_NetworkListState_Private GetState([in] PP_Resource resource, + [in] uint32_t index); /** * Gets list of IP addresses for the network interface with the @@ -113,8 +108,8 @@ interface PPB_NetworkList_Private { int32_t GetIpAddresses( [in] PP_Resource resource, [in] uint32_t index, - [inout, size_is(count)] PP_NetAddress_Private[] addresses, - [in] uint32_t count); + [out, size_is(count)] PP_NetAddress_Private[] addresses, + [in] int32_t count); /** * @return Returns display name for the network interface with the @@ -125,7 +120,7 @@ interface PPB_NetworkList_Private { /** * @return Returns MTU for the network interface with the specified - * <code>index</code> or 0 if MTU is unknown. + * <code>index</code>. */ uint32_t GetMTU([in] PP_Resource resource, [in] uint32_t index); diff --git a/ppapi/c/private/ppb_network_list_private.h b/ppapi/c/private/ppb_network_list_private.h index 2cba362..90cbbe8 100644 --- a/ppapi/c/private/ppb_network_list_private.h +++ b/ppapi/c/private/ppb_network_list_private.h @@ -4,7 +4,7 @@ */ /* From private/ppb_network_list_private.idl, - * modified Thu Mar 1 16:24:33 2012. + * modified Fri Feb 24 10:14:10 2012. */ #ifndef PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ @@ -35,21 +35,17 @@ */ typedef enum { /** - * Type of the network interface is not known. - */ - PP_NETWORKLIST_UNKNOWN = 0, - /** * Wired Ethernet network. */ - PP_NETWORKLIST_ETHERNET = 1, + PP_NETWORKLIST_ETHERNET = 0, /** * Wireless Wi-Fi network. */ - PP_NETWORKLIST_WIFI = 2, + PP_NETWORKLIST_WIFI = 1, /** * Cellular network (e.g. LTE). */ - PP_NETWORKLIST_CELLULAR = 3 + PP_NETWORKLIST_CELLULAR = 2 } PP_NetworkListType_Private; PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListType_Private, 4); @@ -126,8 +122,8 @@ struct PPB_NetworkList_Private_0_2 { */ int32_t (*GetIpAddresses)(PP_Resource resource, uint32_t index, - struct PP_NetAddress_Private addresses[], - uint32_t count); + struct PP_NetAddress_Private* addresses[], + int32_t count); /** * @return Returns display name for the network interface with the * specified <code>index</code>. @@ -135,7 +131,7 @@ struct PPB_NetworkList_Private_0_2 { struct PP_Var (*GetDisplayName)(PP_Resource resource, uint32_t index); /** * @return Returns MTU for the network interface with the specified - * <code>index</code> or 0 if MTU is unknown. + * <code>index</code>. */ uint32_t (*GetMTU)(PP_Resource resource, uint32_t index); }; diff --git a/ppapi/cpp/private/network_list_private.cc b/ppapi/cpp/private/network_list_private.cc deleted file mode 100644 index d08410e..0000000 --- a/ppapi/cpp/private/network_list_private.cc +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// 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/module_impl.h" -#include "ppapi/cpp/var.h" - -namespace pp { - -namespace { - -template <> const char* interface_name<PPB_NetworkList_Private>() { - return PPB_NETWORKLIST_PRIVATE_INTERFACE; -} - -} // namespace - -NetworkListPrivate::NetworkListPrivate(PP_Resource resource) - : Resource(resource) { -} - -// static -bool NetworkListPrivate::IsAvailable() { - return has_interface<PPB_NetworkList_Private>(); -} - -uint32_t NetworkListPrivate::GetCount() { - if (!has_interface<PPB_NetworkList_Private>()) - return 0; - return get_interface<PPB_NetworkList_Private>()->GetCount(pp_resource()); -} - -std::string NetworkListPrivate::GetName(uint32_t index) { - if (!has_interface<PPB_NetworkList_Private>()) - return std::string(); - Var result(PASS_REF, - get_interface<PPB_NetworkList_Private>()->GetName( - pp_resource(), index)); - return result.is_string() ? result.AsString() : std::string(); -} - -PP_NetworkListType_Private NetworkListPrivate::GetType(uint32_t index) { - if (!has_interface<PPB_NetworkList_Private>()) - return PP_NETWORKLIST_ETHERNET; - return get_interface<PPB_NetworkList_Private>()->GetType( - pp_resource(), index); -} - -PP_NetworkListState_Private NetworkListPrivate::GetState(uint32_t index) { - if (!has_interface<PPB_NetworkList_Private>()) - return PP_NETWORKLIST_DOWN; - return get_interface<PPB_NetworkList_Private>()->GetState( - pp_resource(), index); -} - -void NetworkListPrivate::GetIpAddresses( - uint32_t index, - std::vector<PP_NetAddress_Private>* addresses) { - if (!has_interface<PPB_NetworkList_Private>()) - return; - - // Most netword interfaces don't have more than 3 network - // interfaces. - addresses->resize(3); - - int32_t result = get_interface<PPB_NetworkList_Private>()->GetIpAddresses( - pp_resource(), index, &addresses->front(), addresses->size()); - - if (result < 0) { - addresses->resize(0); - return; - } - - if (result <= static_cast<int32_t>(addresses->size())) { - addresses->resize(result); - return; - } - - addresses->resize(result); - result = get_interface<PPB_NetworkList_Private>()->GetIpAddresses( - pp_resource(), index, &addresses->front(), addresses->size()); - if (result < 0) { - addresses->resize(0); - } else if (result < static_cast<int32_t>(addresses->size())) { - addresses->resize(result); - } -} - -std::string NetworkListPrivate::GetDisplayName(uint32_t index) { - if (!has_interface<PPB_NetworkList_Private>()) - return std::string(); - Var result(PASS_REF, - get_interface<PPB_NetworkList_Private>()->GetDisplayName( - pp_resource(), index)); - return result.is_string() ? result.AsString() : std::string(); -} - -uint32_t NetworkListPrivate::GetMTU(uint32_t index) { - if (!has_interface<PPB_NetworkList_Private>()) - return 0; - return get_interface<PPB_NetworkList_Private>()->GetMTU( - pp_resource(), index); -} - -} // namespace pp diff --git a/ppapi/cpp/private/network_list_private.h b/ppapi/cpp/private/network_list_private.h deleted file mode 100644 index 223941d1..0000000 --- a/ppapi/cpp/private/network_list_private.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_ -#define PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_ - -#include <string> -#include <vector> - -#include "ppapi/c/private/ppb_network_list_private.h" -#include "ppapi/cpp/resource.h" - -namespace pp { - -class NetworkListPrivate : public Resource { - public: - explicit NetworkListPrivate(PP_Resource resource); - - /// Returns true if the required interface is available. - static bool IsAvailable(); - - /// @return Returns the number of available network interfaces or 0 - /// if the list has never been updated. - uint32_t GetCount(); - - /// @return Returns the name for the network interface with the - /// specified <code>index</code>. - std::string GetName(uint32_t index); - - /// @return Returns the type of the network interface with the - /// specified <code>index</code>. - PP_NetworkListType_Private GetType(uint32_t index); - - /// @return Returns the current state of the network interface with - /// the specified <code>index</code>. - PP_NetworkListState_Private GetState(uint32_t index); - - /// Gets the list of IP addresses for the network interface with the - /// specified <code>index</code> and stores them in - /// <code>addresses</code>. - void GetIpAddresses(uint32_t index, - std::vector<PP_NetAddress_Private>* addresses); - - /// @return Returns the display name for the network interface with - /// the specified <code>index</code>. - std::string GetDisplayName(uint32_t index); - - /// @return Returns the MTU for the network interface with the - /// specified <code>index</code>. - uint32_t GetMTU(uint32_t index); -}; - -} // namespace pp - -#endif // PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_ diff --git a/ppapi/cpp/private/network_monitor_private.cc b/ppapi/cpp/private/network_monitor_private.cc deleted file mode 100644 index 2f931ea..0000000 --- a/ppapi/cpp/private/network_monitor_private.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// 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_monitor_private.h" - -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module_impl.h" - -namespace pp { - -namespace { - -template <> const char* interface_name<PPB_NetworkMonitor_Private>() { - return PPB_NETWORKMONITOR_PRIVATE_INTERFACE; -} - -} // namespace - -NetworkMonitorPrivate::NetworkMonitorPrivate( - const InstanceHandle& instance, - PPB_NetworkMonitor_Callback callback, - void* user_data) { - if (has_interface<PPB_NetworkMonitor_Private>()) { - PassRefFromConstructor(get_interface<PPB_NetworkMonitor_Private>()->Create( - instance.pp_instance(), callback, user_data)); - } -} - -// static -bool NetworkMonitorPrivate::IsAvailable() { - return has_interface<PPB_NetworkMonitor_Private>(); -} - -} // namespace pp diff --git a/ppapi/cpp/private/network_monitor_private.h b/ppapi/cpp/private/network_monitor_private.h deleted file mode 100644 index 693bbcd..0000000 --- a/ppapi/cpp/private/network_monitor_private.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_CPP_PRIVATE_NETWORK_MONITOR_PRIVATE_H_ -#define PPAPI_CPP_PRIVATE_NETWORK_MONITOR_PRIVATE_H_ - -#include "ppapi/c/private/ppb_network_monitor_private.h" -#include "ppapi/cpp/resource.h" -#include "ppapi/cpp/instance_handle.h" - -namespace pp { - -class Instance; - -class NetworkMonitorPrivate : public Resource { - public: - NetworkMonitorPrivate(const InstanceHandle& instance, - PPB_NetworkMonitor_Callback callback, - void* user_data); - - // Returns true if the required interface is available. - static bool IsAvailable(); -}; - -} // namespace pp - -#endif // PPAPI_CPP_PRIVATE_NETWORK_MONITOR_PRIVATE_H_ diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi index 8a36c7f..56df78c1 100644 --- a/ppapi/ppapi_shared.gypi +++ b/ppapi/ppapi_shared.gypi @@ -88,8 +88,6 @@ 'shared_impl/ppb_instance_shared.cc', 'shared_impl/ppb_instance_shared.h', 'shared_impl/ppb_memory_shared.cc', - 'shared_impl/ppb_network_list_private_shared.cc', - 'shared_impl/ppb_network_list_private_shared.h', 'shared_impl/ppb_opengles2_shared.cc', 'shared_impl/ppb_opengles2_shared.h', 'shared_impl/ppb_resource_array_shared.cc', @@ -204,10 +202,6 @@ 'thunk/ppb_message_loop_api.h', 'thunk/ppb_messaging_thunk.cc', 'thunk/ppb_mouse_lock_thunk.cc', - 'thunk/ppb_network_list_private_api.h', - 'thunk/ppb_network_list_private_thunk.cc', - 'thunk/ppb_network_monitor_private_api.h', - 'thunk/ppb_network_monitor_private_thunk.cc', 'thunk/ppb_pdf_api.h', 'thunk/ppb_resource_array_api.h', 'thunk/ppb_resource_array_thunk.cc', diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi index 3aa4056..b99e463 100644 --- a/ppapi/ppapi_sources.gypi +++ b/ppapi/ppapi_sources.gypi @@ -102,8 +102,6 @@ 'c/private/ppb_pdf.h', 'c/private/ppb_proxy_private.h', 'c/private/ppp_instance_private.h', - 'c/private/ppb_network_list_private.h', - 'c/private/ppb_network_monitor_private.h', 'c/private/ppb_tcp_socket_private.h', 'c/private/ppb_udp_socket_private.h', @@ -255,10 +253,6 @@ 'cpp/private/instance_private.h', 'cpp/private/net_address_private.cc', 'cpp/private/net_address_private.h', - 'cpp/private/network_list_private.cc', - 'cpp/private/network_list_private.h', - 'cpp/private/network_monitor_private.cc', - 'cpp/private/network_monitor_private.h', 'cpp/private/tcp_socket_private.cc', 'cpp/private/tcp_socket_private.h', 'cpp/private/udp_socket_private.cc', diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index 036492e..4a7ef62 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -58,8 +58,6 @@ #include "ppapi/c/private/ppb_flash_net_connector.h" #include "ppapi/c/private/ppb_flash_tcp_socket.h" #include "ppapi/c/private/ppb_net_address_private.h" -#include "ppapi/c/private/ppb_network_list_private.h" -#include "ppapi/c/private/ppb_network_monitor_private.h" #include "ppapi/c/private/ppb_pdf.h" #include "ppapi/c/private/ppb_tcp_socket_private.h" #include "ppapi/c/private/ppb_udp_socket_private.h" diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc index 962c9ad..40a8924 100644 --- a/ppapi/proxy/resource_creation_proxy.cc +++ b/ppapi/proxy/resource_creation_proxy.cc @@ -238,14 +238,6 @@ PP_Resource ResourceCreationProxy::CreateMouseInputEvent( instance, data))->GetReference(); } -PP_Resource ResourceCreationProxy::CreateNetworkMonitor( - PP_Instance instance, - PPB_NetworkMonitor_Callback callback, - void* user_data) { - NOTIMPLEMENTED(); // Not proxied yet. - return 0; -} - PP_Resource ResourceCreationProxy::CreateGraphics3D( PP_Instance instance, PP_Resource share_context, diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h index 2b9428a..c7f84ab 100644 --- a/ppapi/proxy/resource_creation_proxy.h +++ b/ppapi/proxy/resource_creation_proxy.h @@ -101,10 +101,6 @@ class ResourceCreationProxy : public InterfaceProxy, const PP_Point* mouse_position, int32_t click_count, const PP_Point* mouse_movement) OVERRIDE; - virtual PP_Resource CreateNetworkMonitor( - PP_Instance instance, - PPB_NetworkMonitor_Callback callback, - void* user_data) OVERRIDE; virtual PP_Resource CreateResourceArray(PP_Instance instance, const PP_Resource elements[], uint32_t size) OVERRIDE; diff --git a/ppapi/shared_impl/ppb_network_list_private_shared.cc b/ppapi/shared_impl/ppb_network_list_private_shared.cc deleted file mode 100644 index b06e4c5..0000000 --- a/ppapi/shared_impl/ppb_network_list_private_shared.cc +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <algorithm> - -#include "base/logging.h" -#include "ppapi/c/pp_errors.h" -#include "ppapi/shared_impl/ppb_network_list_private_shared.h" -#include "ppapi/shared_impl/var.h" - -namespace ppapi { - -PPB_NetworkList_Private_Shared::NetworkInfo::NetworkInfo() - : type(PP_NETWORKLIST_UNKNOWN), - state(PP_NETWORKLIST_DOWN), - mtu(0) { -} - -PPB_NetworkList_Private_Shared::NetworkInfo::~NetworkInfo() { -} - -PPB_NetworkList_Private_Shared::PPB_NetworkList_Private_Shared( - ResourceObjectType type, - PP_Instance instance, - scoped_ptr<NetworkList> list) - : Resource(type, instance), - list_(list.Pass()) { -} - -PPB_NetworkList_Private_Shared::~PPB_NetworkList_Private_Shared() { -} - -// static -PP_Resource PPB_NetworkList_Private_Shared::Create( - ResourceObjectType type, - PP_Instance instance, - scoped_ptr<NetworkList> list) { - scoped_refptr<PPB_NetworkList_Private_Shared> object( - new PPB_NetworkList_Private_Shared(type, instance, list.Pass())); - return object->GetReference(); -} - -::ppapi::thunk::PPB_NetworkList_Private_API* -PPB_NetworkList_Private_Shared::AsPPB_NetworkList_Private_API() { - return this; -} - -uint32_t PPB_NetworkList_Private_Shared::GetCount() { - return list_->size(); -} - -PP_Var PPB_NetworkList_Private_Shared::GetName(uint32_t index) { - if (index >= list_->size()) - return PP_MakeUndefined(); - return StringVar::StringToPPVar(list_->at(index).name); -} - -PP_NetworkListType_Private PPB_NetworkList_Private_Shared::GetType( - uint32_t index) { - if (index >= list_->size()) - return PP_NETWORKLIST_UNKNOWN; - return list_->at(index).type; -} - -PP_NetworkListState_Private PPB_NetworkList_Private_Shared::GetState( - uint32_t index) { - if (index >= list_->size()) - return PP_NETWORKLIST_DOWN; - return list_->at(index).state; -} - -int32_t PPB_NetworkList_Private_Shared::GetIpAddresses( - uint32_t index, - struct PP_NetAddress_Private addresses[], - uint32_t count) { - if (index >= list_->size()) - return PP_ERROR_FAILED; - count = std::min( - count, static_cast<uint32_t>(list_->at(index).addresses.size())); - memcpy(addresses, &(list_->at(index).addresses[0]), - sizeof(PP_NetAddress_Private) * count); - return list_->at(index).addresses.size(); -} - -PP_Var PPB_NetworkList_Private_Shared::GetDisplayName(uint32_t index) { - if (index >= list_->size()) - return PP_MakeUndefined(); - return StringVar::StringToPPVar(list_->at(index).display_name); -} - -uint32_t PPB_NetworkList_Private_Shared::GetMTU(uint32_t index) { - if (index >= list_->size()) - return 0; - return list_->at(index).mtu; -} - -} // namespace thunk diff --git a/ppapi/shared_impl/ppb_network_list_private_shared.h b/ppapi/shared_impl/ppb_network_list_private_shared.h deleted file mode 100644 index 731d543..0000000 --- a/ppapi/shared_impl/ppb_network_list_private_shared.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_SHARED_IMPL_PPB_NETWORK_LIST_PRIVATE_SHARED_H_ -#define PPAPI_SHARED_IMPL_PPB_NETWORK_LIST_PRIVATE_SHARED_H_ - -#include <vector> - -#include "base/basictypes.h" -#include "base/memory/scoped_ptr.h" -#include "ppapi/shared_impl/resource.h" -#include "ppapi/thunk/ppb_network_list_private_api.h" - -namespace ppapi { - -class PPAPI_SHARED_EXPORT PPB_NetworkList_Private_Shared - : public ::ppapi::Resource, - public ::ppapi::thunk::PPB_NetworkList_Private_API { - public: - struct NetworkInfo { - NetworkInfo(); - ~NetworkInfo(); - - std::string name; - PP_NetworkListType_Private type; - PP_NetworkListState_Private state; - std::vector<PP_NetAddress_Private> addresses; - std::string display_name; - int mtu; - }; - typedef std::vector<NetworkInfo> NetworkList; - - static PP_Resource Create(ResourceObjectType type, - PP_Instance instance, - scoped_ptr<NetworkList> list); - - virtual ~PPB_NetworkList_Private_Shared(); - - // Resource override. - virtual ::ppapi::thunk::PPB_NetworkList_Private_API* - AsPPB_NetworkList_Private_API() OVERRIDE; - - // PPB_NetworkList_Private_API implementation. - virtual uint32_t GetCount() OVERRIDE; - virtual PP_Var GetName(uint32_t index) OVERRIDE; - virtual PP_NetworkListType_Private GetType(uint32_t index) OVERRIDE; - virtual PP_NetworkListState_Private GetState(uint32_t index) OVERRIDE; - virtual int32_t GetIpAddresses(uint32_t index, - PP_NetAddress_Private addresses[], - uint32_t count) OVERRIDE; - virtual PP_Var GetDisplayName(uint32_t index) OVERRIDE; - virtual uint32_t GetMTU(uint32_t index) OVERRIDE; - - private: - PPB_NetworkList_Private_Shared(ResourceObjectType type, - PP_Instance instance, - scoped_ptr<NetworkList> list); - - scoped_ptr<NetworkList> list_; - - DISALLOW_COPY_AND_ASSIGN(PPB_NetworkList_Private_Shared); -}; - -} // namespace ppapi - -#endif // PPAPI_SHARED_IMPL_PPB_NETWORK_LIST_PRIVATE_SHARED_H_ diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h index 6a1cda9..34df0ea 100644 --- a/ppapi/shared_impl/resource.h +++ b/ppapi/shared_impl/resource.h @@ -44,8 +44,6 @@ F(PPB_InputEvent_API) \ F(PPB_LayerCompositor_API) \ F(PPB_MessageLoop_API) \ - F(PPB_NetworkList_Private_API) \ - F(PPB_NetworkMonitor_Private_API) \ F(PPB_PDFFont_API) \ F(PPB_ResourceArray_API) \ F(PPB_Scrollbar_API) \ diff --git a/ppapi/thunk/interfaces_ppb_private.h b/ppapi/thunk/interfaces_ppb_private.h index 9adaa45..1b43ebe 100644 --- a/ppapi/thunk/interfaces_ppb_private.h +++ b/ppapi/thunk/interfaces_ppb_private.h @@ -35,12 +35,6 @@ PROXIED_IFACE(PPB_UDPSocket_Private, PPB_UDPSOCKET_PRIVATE_INTERFACE_0_2, PROXIED_IFACE(PPB_UDPSocket_Private, PPB_UDPSOCKET_PRIVATE_INTERFACE_0_3, PPB_UDPSocket_Private_0_3) -UNPROXIED_IFACE(PPB_NetworkList_Private, PPB_NETWORKLIST_PRIVATE_INTERFACE_0_2, - PPB_NetworkList_Private_0_2) -UNPROXIED_IFACE(PPB_NetworkMonitor_Private, - PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2, - PPB_NetworkMonitor_Private_0_2) - // Hack to keep font working. The Font 0.6 API is binary compatible with // BrowserFont 1.0, so just map the string to the same thing. // TODO(brettw) remove support for the old Font API. diff --git a/ppapi/thunk/ppb_network_list_private_api.h b/ppapi/thunk/ppb_network_list_private_api.h deleted file mode 100644 index 9c089e5..0000000 --- a/ppapi/thunk/ppb_network_list_private_api.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_PPB_NETWORK_LIST_PRIVATE_API_H_ -#define PPAPI_THUNK_PPB_NETWORK_LIST_PRIVATE_API_H_ - -#include "ppapi/c/private/ppb_network_list_private.h" - -namespace ppapi { -namespace thunk { - -class PPB_NetworkList_Private_API { - public: - virtual ~PPB_NetworkList_Private_API() {} - - virtual uint32_t GetCount() = 0; - virtual PP_Var GetName(uint32_t index) = 0; - virtual PP_NetworkListType_Private GetType(uint32_t index) = 0; - virtual PP_NetworkListState_Private GetState(uint32_t index) = 0; - virtual int32_t GetIpAddresses(uint32_t index, - PP_NetAddress_Private addresses[], - uint32_t count) = 0; - virtual PP_Var GetDisplayName(uint32_t index) = 0; - virtual uint32_t GetMTU(uint32_t index) = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_NETWORK_LIST_PRIVATE_API_H_ diff --git a/ppapi/thunk/ppb_network_list_private_thunk.cc b/ppapi/thunk/ppb_network_list_private_thunk.cc deleted file mode 100644 index a5ee1e4..0000000 --- a/ppapi/thunk/ppb_network_list_private_thunk.cc +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/ppb_network_list_private_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -typedef EnterResource<PPB_NetworkList_Private_API> EnterNetworkList; - -PP_Bool IsNetworkList(PP_Resource resource) { - EnterNetworkList enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -uint32_t GetCount(PP_Resource network_list) { - EnterNetworkList enter(network_list, true); - if (enter.failed()) - return 0; - return enter.object()->GetCount(); -} - -PP_Var GetName(PP_Resource network_list, uint32_t index) { - EnterNetworkList enter(network_list, true); - if (enter.failed()) - return PP_MakeUndefined(); - return enter.object()->GetName(index); -} - -PP_NetworkListType_Private GetType(PP_Resource network_list, uint32_t index) { - EnterNetworkList enter(network_list, true); - if (enter.failed()) - return PP_NETWORKLIST_UNKNOWN; - return enter.object()->GetType(index); -} - -PP_NetworkListState_Private GetState(PP_Resource network_list, uint32_t index) { - EnterNetworkList enter(network_list, true); - if (enter.failed()) - return PP_NETWORKLIST_DOWN; - return enter.object()->GetState(index); -} - -int32_t GetIpAddresses(PP_Resource network_list, - uint32_t index, - struct PP_NetAddress_Private addresses[], - uint32_t count) { - EnterNetworkList enter(network_list, true); - if (enter.failed()) - return enter.retval(); - return enter.object()->GetIpAddresses(index, addresses, count); -} - -PP_Var GetDisplayName(PP_Resource network_list, uint32_t index) { - EnterNetworkList enter(network_list, true); - if (enter.failed()) - return PP_MakeUndefined(); - return enter.object()->GetDisplayName(index); -} - -uint32_t GetMTU(PP_Resource network_list, uint32_t index) { - EnterNetworkList enter(network_list, true); - if (enter.failed()) - return 0; - return enter.object()->GetMTU(index); -} - -const PPB_NetworkList_Private g_ppb_network_list_private_thunk = { - &IsNetworkList, - &GetCount, - &GetName, - &GetType, - &GetState, - &GetIpAddresses, - &GetDisplayName, - &GetMTU, -}; - -} // namespace - -const PPB_NetworkList_Private_0_2* GetPPB_NetworkList_Private_0_2_Thunk() { - return &g_ppb_network_list_private_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_network_monitor_private_api.h b/ppapi/thunk/ppb_network_monitor_private_api.h deleted file mode 100644 index d0e6820..0000000 --- a/ppapi/thunk/ppb_network_monitor_private_api.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_PPB_NETWORK_MONITOR_PRIVATE_API_H_ -#define PPAPI_THUNK_PPB_NETWORK_MONITOR_PRIVATE_API_H_ - -#include "ppapi/c/private/ppb_network_monitor_private.h" - -namespace ppapi { -namespace thunk { - -class PPB_NetworkMonitor_Private_API { - public: - virtual ~PPB_NetworkMonitor_Private_API() {} -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_NETWORK_MONITOR_PRIVATE_API_H_ diff --git a/ppapi/thunk/ppb_network_monitor_private_thunk.cc b/ppapi/thunk/ppb_network_monitor_private_thunk.cc deleted file mode 100644 index e692601..0000000 --- a/ppapi/thunk/ppb_network_monitor_private_thunk.cc +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/ppb_network_monitor_private_api.h" -#include "ppapi/thunk/resource_creation_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -typedef EnterResource<PPB_NetworkMonitor_Private_API> EnterNetworkMonitor; - -PP_Resource Create(PP_Instance instance, - PPB_NetworkMonitor_Callback callback, - void* user_data) { - EnterFunction<ResourceCreationAPI> enter(instance, true); - if (enter.failed()) - return 0; - return enter.functions()->CreateNetworkMonitor(instance, callback, user_data); -} - -PP_Bool IsNetworkMonitor(PP_Resource resource) { - EnterNetworkMonitor enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -const PPB_NetworkMonitor_Private g_ppb_network_monitor_private_thunk = { - &Create, - &IsNetworkMonitor, -}; - -} // namespace - -const PPB_NetworkMonitor_Private_0_2* -GetPPB_NetworkMonitor_Private_0_2_Thunk() { - return &g_ppb_network_monitor_private_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h index 8b9360f5..d567a18 100644 --- a/ppapi/thunk/resource_creation_api.h +++ b/ppapi/thunk/resource_creation_api.h @@ -20,7 +20,6 @@ #include "ppapi/c/ppb_websocket.h" #include "ppapi/c/dev/pp_video_dev.h" #include "ppapi/c/dev/ppb_transport_dev.h" -#include "ppapi/c/private/ppb_network_monitor_private.h" #include "ppapi/shared_impl/api_id.h" struct PP_Flash_Menu; @@ -104,10 +103,6 @@ class ResourceCreationAPI { const PP_Point* mouse_position, int32_t click_count, const PP_Point* mouse_movement) = 0; - virtual PP_Resource CreateNetworkMonitor( - PP_Instance instance, - PPB_NetworkMonitor_Callback callback, - void* user_data) = 0; virtual PP_Resource CreateResourceArray(PP_Instance instance, const PP_Resource elements[], uint32_t size) = 0; |