summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/private/ppb_flash_net_connector.h46
-rw-r--r--ppapi/cpp/private/flash_net_connector.cc62
-rw-r--r--ppapi/cpp/private/flash_net_connector.h38
-rw-r--r--ppapi/ppapi_proxy.gypi2
-rw-r--r--ppapi/ppapi_proxy_untrusted.gyp1
-rw-r--r--ppapi/ppapi_shared.gypi2
-rw-r--r--ppapi/ppapi_sources.gypi3
-rw-r--r--ppapi/proxy/interface_list.cc9
-rw-r--r--ppapi/proxy/ppapi_messages.h20
-rw-r--r--ppapi/proxy/ppb_flash_net_connector_proxy.cc306
-rw-r--r--ppapi/proxy/ppb_flash_net_connector_proxy.h59
-rw-r--r--ppapi/proxy/resource_creation_proxy.cc6
-rw-r--r--ppapi/proxy/resource_creation_proxy.h1
-rw-r--r--ppapi/shared_impl/api_id.h1
-rw-r--r--ppapi/shared_impl/resource.h1
-rw-r--r--ppapi/thunk/ppb_flash_net_connector_api.h33
-rw-r--r--ppapi/thunk/ppb_flash_net_connector_thunk.cc73
-rw-r--r--ppapi/thunk/resource_creation_api.h1
-rw-r--r--ppapi/thunk/thunk.h3
19 files changed, 0 insertions, 667 deletions
diff --git a/ppapi/c/private/ppb_flash_net_connector.h b/ppapi/c/private/ppb_flash_net_connector.h
deleted file mode 100644
index b3bda63..0000000
--- a/ppapi/c/private/ppb_flash_net_connector.h
+++ /dev/null
@@ -1,46 +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_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_
-#define PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_
-
-// TODO(viettrungluu): Remove this interface; it's on life-support right now.
-
-#include "ppapi/c/pp_bool.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/c/pp_resource.h"
-#include "ppapi/c/private/ppb_flash_file.h" // For |PP_FileHandle|.
-#include "ppapi/c/private/ppb_net_address_private.h"
-
-#define PPB_FLASH_NETCONNECTOR_INTERFACE_0_2 "PPB_Flash_NetConnector;0.2"
-#define PPB_FLASH_NETCONNECTOR_INTERFACE PPB_FLASH_NETCONNECTOR_INTERFACE_0_2
-
-struct PPB_Flash_NetConnector_0_2 {
- PP_Resource (*Create)(PP_Instance instance_id);
- PP_Bool (*IsFlashNetConnector)(PP_Resource resource_id);
-
- // Connect to a TCP port given as a host-port pair. The local and remote
- // addresses of the connection (if successful) are returned in
- // |local_addr_out| and |remote_addr_out|, respectively, if non-null.
- int32_t (*ConnectTcp)(PP_Resource connector_id,
- const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- struct PP_NetAddress_Private* local_addr_out,
- struct PP_NetAddress_Private* remote_addr_out,
- struct PP_CompletionCallback callback);
-
- // Same as |ConnectTcp()|, but connecting to the address given by |addr|. A
- // typical use-case would be for reconnections.
- int32_t (*ConnectTcpAddress)(PP_Resource connector_id,
- const struct PP_NetAddress_Private* addr,
- PP_FileHandle* socket_out,
- struct PP_NetAddress_Private* local_addr_out,
- struct PP_NetAddress_Private* remote_addr_out,
- struct PP_CompletionCallback callback);
-};
-
-typedef struct PPB_Flash_NetConnector_0_2 PPB_Flash_NetConnector;
-
-#endif // PPAPI_C_PRIVATE_PPB_FLASH_NET_CONNECTOR_H_
diff --git a/ppapi/cpp/private/flash_net_connector.cc b/ppapi/cpp/private/flash_net_connector.cc
deleted file mode 100644
index b448e7e..0000000
--- a/ppapi/cpp/private/flash_net_connector.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2011 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/flash_net_connector.h"
-
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/cpp/completion_callback.h"
-#include "ppapi/cpp/instance_handle.h"
-#include "ppapi/cpp/module.h"
-#include "ppapi/cpp/module_impl.h"
-
-namespace pp {
-
-namespace {
-
-template <> const char* interface_name<PPB_Flash_NetConnector>() {
- return PPB_FLASH_NETCONNECTOR_INTERFACE;
-}
-
-} // namespace
-
-namespace flash {
-
-NetConnector::NetConnector(const InstanceHandle& instance) {
- if (has_interface<PPB_Flash_NetConnector>()) {
- PassRefFromConstructor(get_interface<PPB_Flash_NetConnector>()->Create(
- instance.pp_instance()));
- }
-}
-
-int32_t NetConnector::ConnectTcp(const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- const CompletionCallback& cc) {
- if (!has_interface<PPB_Flash_NetConnector>())
- return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_Flash_NetConnector>()->ConnectTcp(
- pp_resource(),
- host, port,
- socket_out, local_addr_out, remote_addr_out,
- cc.pp_completion_callback());
-}
-
-int32_t NetConnector::ConnectTcpAddress(const PP_NetAddress_Private* addr,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- const CompletionCallback& cc) {
- if (!has_interface<PPB_Flash_NetConnector>())
- return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_Flash_NetConnector>()->ConnectTcpAddress(
- pp_resource(),
- addr,
- socket_out, local_addr_out, remote_addr_out,
- cc.pp_completion_callback());
-}
-
-} // namespace flash
-} // namespace pp
diff --git a/ppapi/cpp/private/flash_net_connector.h b/ppapi/cpp/private/flash_net_connector.h
deleted file mode 100644
index eb064ba..0000000
--- a/ppapi/cpp/private/flash_net_connector.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2011 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_FLASH_NET_CONNECTOR_H_
-#define PPAPI_CPP_PRIVATE_FLASH_NET_CONNECTOR_H_
-
-#include "ppapi/c/private/ppb_flash_net_connector.h"
-#include "ppapi/cpp/resource.h"
-
-namespace pp {
-
-class CompletionCallback;
-class InstanceHandle;
-
-namespace flash {
-
-class NetConnector : public Resource {
- public:
- explicit NetConnector(const InstanceHandle& instance);
-
- int32_t ConnectTcp(const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- const CompletionCallback& cc);
- int32_t ConnectTcpAddress(const PP_NetAddress_Private* addr,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- const CompletionCallback& cc);
-};
-
-} // namespace flash
-} // namespace pp
-
-#endif // PPAPI_CPP_PRIVATE_FLASH_NET_CONNECTOR_H_
diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi
index 17850f1..c623f73 100644
--- a/ppapi/ppapi_proxy.gypi
+++ b/ppapi/ppapi_proxy.gypi
@@ -100,8 +100,6 @@
'proxy/ppb_flash_menu_proxy.h',
'proxy/ppb_flash_message_loop_proxy.cc',
'proxy/ppb_flash_message_loop_proxy.h',
- 'proxy/ppb_flash_net_connector_proxy.cc',
- 'proxy/ppb_flash_net_connector_proxy.h',
'proxy/ppb_graphics_2d_proxy.cc',
'proxy/ppb_graphics_2d_proxy.h',
'proxy/ppb_graphics_3d_proxy.cc',
diff --git a/ppapi/ppapi_proxy_untrusted.gyp b/ppapi/ppapi_proxy_untrusted.gyp
index 9893599..fa611fa 100644
--- a/ppapi/ppapi_proxy_untrusted.gyp
+++ b/ppapi/ppapi_proxy_untrusted.gyp
@@ -306,7 +306,6 @@
'thunk/ppb_flash_fullscreen_thunk.cc',
'thunk/ppb_flash_menu_thunk.cc',
'thunk/ppb_flash_message_loop_thunk.cc',
- 'thunk/ppb_flash_net_connector_thunk.cc',
'thunk/ppb_fullscreen_thunk.cc',
'thunk/ppb_gamepad_thunk.cc',
'thunk/ppb_gles_chromium_texture_mapping_thunk.cc',
diff --git a/ppapi/ppapi_shared.gypi b/ppapi/ppapi_shared.gypi
index f1621e2..1055660 100644
--- a/ppapi/ppapi_shared.gypi
+++ b/ppapi/ppapi_shared.gypi
@@ -190,8 +190,6 @@
'thunk/ppb_flash_menu_thunk.cc',
'thunk/ppb_flash_message_loop_api.h',
'thunk/ppb_flash_message_loop_thunk.cc',
- 'thunk/ppb_flash_net_connector_api.h',
- 'thunk/ppb_flash_net_connector_thunk.cc',
'thunk/ppb_fullscreen_thunk.cc',
'thunk/ppb_gamepad_thunk.cc',
'thunk/ppb_gles_chromium_texture_mapping_thunk.cc',
diff --git a/ppapi/ppapi_sources.gypi b/ppapi/ppapi_sources.gypi
index 536f8f3..19d8919 100644
--- a/ppapi/ppapi_sources.gypi
+++ b/ppapi/ppapi_sources.gypi
@@ -94,7 +94,6 @@
'c/private/ppb_flash_fullscreen.h',
'c/private/ppb_flash_menu.h',
'c/private/ppb_flash_message_loop.h',
- 'c/private/ppb_flash_net_connector.h',
'c/private/ppb_flash_tcp_socket.h',
'c/private/ppb_flash_udp_socket.h',
'c/private/ppb_gpu_blacklist_private.h',
@@ -256,8 +255,6 @@
'cpp/private/flash_menu.h',
'cpp/private/flash_message_loop.cc',
'cpp/private/flash_message_loop.h',
- 'cpp/private/flash_net_connector.cc',
- 'cpp/private/flash_net_connector.h',
'cpp/private/host_resolver_private.cc',
'cpp/private/host_resolver_private.h',
'cpp/private/instance_private.cc',
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc
index 5728b54..b63a309 100644
--- a/ppapi/proxy/interface_list.cc
+++ b/ppapi/proxy/interface_list.cc
@@ -55,7 +55,6 @@
#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/c/private/ppb_flash_menu.h"
#include "ppapi/c/private/ppb_flash_message_loop.h"
-#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"
@@ -84,7 +83,6 @@
#include "ppapi/proxy/ppb_flash_file_proxy.h"
#include "ppapi/proxy/ppb_flash_menu_proxy.h"
#include "ppapi/proxy/ppb_flash_message_loop_proxy.h"
-#include "ppapi/proxy/ppb_flash_net_connector_proxy.h"
#include "ppapi/proxy/ppb_flash_proxy.h"
#include "ppapi/proxy/ppb_graphics_2d_proxy.h"
#include "ppapi/proxy/ppb_graphics_3d_proxy.h"
@@ -335,13 +333,6 @@ void InterfaceList::AddFlashInterfaces() {
// Only add the interface; PPB_TCPSocket_Private provides the API ID's proxy.
AddPPB(PPB_FLASH_TCPSOCKET_INTERFACE_0_2, API_ID_PPB_TCPSOCKET_PRIVATE,
thunk::GetPPB_TCPSocket_Private_0_3_Thunk());
-
-#ifdef ENABLE_FLAPPER_HACKS
- AddProxy(API_ID_PPB_FLASH_NETCONNECTOR,
- &ProxyFactory<PPB_Flash_NetConnector_Proxy>);
- AddPPB(PPB_FLASH_NETCONNECTOR_INTERFACE_0_2, API_ID_PPB_FLASH_NETCONNECTOR,
- thunk::GetPPB_Flash_NetConnector_0_2_Thunk());
-#endif
#endif // !defined(OS_NACL)
}
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index dc46b5a..0a2dcf2 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1139,14 +1139,6 @@ IPC_SYNC_MESSAGE_ROUTED1_0(PpapiHostMsg_PPBVideoDecoder_Destroy,
ppapi::HostResource /* video_decoder */)
#if !defined(OS_NACL)
-// PPB_Flash_NetConnector.
-IPC_MESSAGE_ROUTED5(PpapiMsg_PPBFlashNetConnector_ConnectACK,
- ppapi::HostResource /* net_connector */,
- int32_t /* result */,
- IPC::PlatformFileForTransit /* handle */,
- std::string /* local_addr_as_string */,
- std::string /* remote_addr_as_string */)
-
// PPB_Flash.
IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop,
PP_Instance /* instance */,
@@ -1265,18 +1257,6 @@ IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFlashMessageLoop_Run,
IPC_SYNC_MESSAGE_ROUTED1_0(PpapiHostMsg_PPBFlashMessageLoop_Quit,
ppapi::HostResource /* flash_message_loop */)
-// PPB_Flash_NetConnector.
-IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFlashNetConnector_Create,
- PP_Instance /* instance_id */,
- ppapi::HostResource /* result */)
-IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBFlashNetConnector_ConnectTcp,
- ppapi::HostResource /* connector */,
- std::string /* host */,
- uint16_t /* port */)
-IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFlashNetConnector_ConnectTcpAddress,
- ppapi::HostResource /* connector */,
- std::string /* net_address_as_string */)
-
// PPB_TCPSocket_Private.
IPC_SYNC_MESSAGE_CONTROL2_1(PpapiHostMsg_PPBTCPSocket_Create,
int32 /* routing_id */,
diff --git a/ppapi/proxy/ppb_flash_net_connector_proxy.cc b/ppapi/proxy/ppb_flash_net_connector_proxy.cc
deleted file mode 100644
index 0b7ba10..0000000
--- a/ppapi/proxy/ppb_flash_net_connector_proxy.cc
+++ /dev/null
@@ -1,306 +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/proxy/ppb_flash_net_connector_proxy.h"
-
-#include <algorithm>
-
-#include "base/bind.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/private/ppb_flash_net_connector.h"
-#include "ppapi/proxy/enter_proxy.h"
-#include "ppapi/proxy/plugin_dispatcher.h"
-#include "ppapi/proxy/ppapi_messages.h"
-#include "ppapi/proxy/serialized_var.h"
-#include "ppapi/shared_impl/tracked_callback.h"
-#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/ppb_flash_net_connector_api.h"
-#include "ppapi/thunk/resource_creation_api.h"
-#include "ppapi/thunk/thunk.h"
-
-using ppapi::thunk::EnterFunctionNoLock;
-using ppapi::thunk::PPB_Flash_NetConnector_API;
-using ppapi::thunk::ResourceCreationAPI;
-
-namespace ppapi {
-namespace proxy {
-
-std::string NetAddressToString(const PP_NetAddress_Private& addr) {
- return std::string(addr.data, std::min(static_cast<size_t>(addr.size),
- sizeof(addr.data)));
-}
-
-void StringToNetAddress(const std::string& str, PP_NetAddress_Private* addr) {
- addr->size = std::min(str.size(), sizeof(addr->data));
- memcpy(addr->data, str.data(), addr->size);
-}
-
-class FlashNetConnector : public PPB_Flash_NetConnector_API,
- public Resource {
- public:
- explicit FlashNetConnector(const HostResource& resource);
- virtual ~FlashNetConnector();
-
- // Resource overrides.
- virtual PPB_Flash_NetConnector_API* AsPPB_Flash_NetConnector_API() OVERRIDE;
-
- // PPB_Flash_NetConnector_API implementation.
- virtual int32_t ConnectTcp(const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) OVERRIDE;
- virtual int32_t ConnectTcpAddress(const PP_NetAddress_Private* addr,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) OVERRIDE;
-
- void ConnectComplete(int32_t result,
- base::PlatformFile file,
- const std::string& local_addr_as_string,
- const std::string& remote_addr_as_string);
-
- private:
- // Backend for both ConnectTcp and ConnectTcpAddress. To keep things generic,
- // the message is passed in (on error, it's deleted).
- int32_t ConnectWithMessage(IPC::Message* msg,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback);
-
- scoped_refptr<TrackedCallback> callback_;
- PP_FileHandle* socket_out_;
- PP_NetAddress_Private* local_addr_out_;
- PP_NetAddress_Private* remote_addr_out_;
-};
-
-FlashNetConnector::FlashNetConnector(const HostResource& resource)
- : Resource(OBJECT_IS_PROXY, resource),
- socket_out_(NULL),
- local_addr_out_(NULL),
- remote_addr_out_(NULL) {
-}
-
-FlashNetConnector::~FlashNetConnector() {
-}
-
-PPB_Flash_NetConnector_API* FlashNetConnector::AsPPB_Flash_NetConnector_API() {
- return this;
-}
-
-int32_t FlashNetConnector::ConnectTcp(
- const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) {
- return ConnectWithMessage(
- new PpapiHostMsg_PPBFlashNetConnector_ConnectTcp(
- API_ID_PPB_FLASH_NETCONNECTOR, host_resource(), host, port),
- socket_out, local_addr_out, remote_addr_out, callback);
-}
-
-int32_t FlashNetConnector::ConnectTcpAddress(
- const PP_NetAddress_Private* addr,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) {
- return ConnectWithMessage(
- new PpapiHostMsg_PPBFlashNetConnector_ConnectTcpAddress(
- API_ID_PPB_FLASH_NETCONNECTOR,
- host_resource(), NetAddressToString(*addr)),
- socket_out, local_addr_out, remote_addr_out, callback);
-}
-
-void FlashNetConnector::ConnectComplete(
- int32_t result,
- base::PlatformFile file,
- const std::string& local_addr_as_string,
- const std::string& remote_addr_as_string) {
- if (TrackedCallback::IsPending(callback_)) {
- base::ClosePlatformFile(file);
- return;
- }
-
- *socket_out_ = static_cast<PP_FileHandle>(file);
- StringToNetAddress(local_addr_as_string, local_addr_out_);
- StringToNetAddress(remote_addr_as_string, remote_addr_out_);
-
- TrackedCallback::ClearAndRun(&callback_, result);
-}
-
-int32_t FlashNetConnector::ConnectWithMessage(
- IPC::Message* msg,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) {
- scoped_ptr<IPC::Message> msg_deletor(msg);
- if (TrackedCallback::IsPending(callback_))
- return PP_ERROR_INPROGRESS; // Can only have one pending request.
-
- // Send the request, it will call us back via ConnectACK.
- PluginDispatcher::GetForResource(this)->Send(msg_deletor.release());
-
- callback_ = new TrackedCallback(this, callback);
- socket_out_ = socket_out;
- local_addr_out_ = local_addr_out;
- remote_addr_out_ = remote_addr_out;
- return PP_OK_COMPLETIONPENDING;
-}
-
-// Contains the data that the host interface will write to so we can send it
-// to the plugin. This is created when a request is initiated, and deleted in
-// the callback handler.
-struct PPB_Flash_NetConnector_Proxy::ConnectCallbackInfo {
- ConnectCallbackInfo(const HostResource& r) : resource(r), handle(0) {
- memset(&local_addr, 0, sizeof(local_addr));
- memset(&remote_addr, 0, sizeof(remote_addr));
- }
-
- HostResource resource;
-
- PP_FileHandle handle;
- PP_NetAddress_Private local_addr;
- PP_NetAddress_Private remote_addr;
-};
-
-PPB_Flash_NetConnector_Proxy::PPB_Flash_NetConnector_Proxy(
- Dispatcher* dispatcher)
- : InterfaceProxy(dispatcher),
- callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
-}
-
-PPB_Flash_NetConnector_Proxy::~PPB_Flash_NetConnector_Proxy() {
-}
-
-// static
-PP_Resource PPB_Flash_NetConnector_Proxy::CreateProxyResource(
- PP_Instance instance) {
- PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
- if (!dispatcher)
- return 0;
-
- HostResource result;
- dispatcher->Send(new PpapiHostMsg_PPBFlashNetConnector_Create(
- API_ID_PPB_FLASH_NETCONNECTOR, instance, &result));
- if (result.is_null())
- return 0;
- return (new FlashNetConnector(result))->GetReference();
-}
-
-bool PPB_Flash_NetConnector_Proxy::OnMessageReceived(const IPC::Message& msg) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(PPB_Flash_NetConnector_Proxy, msg)
- IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_Create,
- OnMsgCreate)
- IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_ConnectTcp,
- OnMsgConnectTcp)
- IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashNetConnector_ConnectTcpAddress,
- OnMsgConnectTcpAddress)
- IPC_MESSAGE_HANDLER(PpapiMsg_PPBFlashNetConnector_ConnectACK,
- OnMsgConnectACK)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void PPB_Flash_NetConnector_Proxy::OnMsgCreate(PP_Instance instance,
- HostResource* result) {
- thunk::EnterResourceCreation enter(instance);
- if (enter.succeeded()) {
- result->SetHostResource(
- instance,
- enter.functions()->CreateFlashNetConnector(instance));
- }
-}
-
-void PPB_Flash_NetConnector_Proxy::OnMsgConnectTcp(
- const HostResource& resource,
- const std::string& host,
- uint16_t port) {
- ConnectCallbackInfo* info = new ConnectCallbackInfo(resource);
- pp::CompletionCallback callback = callback_factory_.NewOptionalCallback(
- &PPB_Flash_NetConnector_Proxy::OnCompleteCallbackInHost, info);
-
- EnterHostFromHostResource<PPB_Flash_NetConnector_API> enter(resource);
- int32_t result = PP_ERROR_BADRESOURCE;
- if (enter.succeeded()) {
- result = enter.object()->ConnectTcp(
- host.c_str(), port, &info->handle, &info->local_addr,
- &info->remote_addr, callback.pp_completion_callback());
- }
- if (result != PP_OK_COMPLETIONPENDING)
- OnCompleteCallbackInHost(result, info);
-}
-
-void PPB_Flash_NetConnector_Proxy::OnMsgConnectTcpAddress(
- const HostResource& resource,
- const std::string& net_address_as_string) {
- ConnectCallbackInfo* info = new ConnectCallbackInfo(resource);
- pp::CompletionCallback callback = callback_factory_.NewOptionalCallback(
- &PPB_Flash_NetConnector_Proxy::OnCompleteCallbackInHost, info);
-
- PP_NetAddress_Private net_address;
- StringToNetAddress(net_address_as_string, &net_address);
-
- EnterHostFromHostResource<PPB_Flash_NetConnector_API> enter(resource);
- int32_t result = PP_ERROR_BADRESOURCE;
- if (enter.succeeded()) {
- result = enter.object()->ConnectTcpAddress(
- &net_address, &info->handle, &info->local_addr, &info->remote_addr,
- callback.pp_completion_callback());
- }
- if (result != PP_OK_COMPLETIONPENDING)
- OnCompleteCallbackInHost(result, info);
-}
-
-void PPB_Flash_NetConnector_Proxy::OnMsgConnectACK(
- const HostResource& host_resource,
- int32_t result,
- IPC::PlatformFileForTransit handle,
- const std::string& load_addr_as_string,
- const std::string& remote_addr_as_string) {
- base::PlatformFile platform_file =
- IPC::PlatformFileForTransitToPlatformFile(handle);
-
- EnterPluginFromHostResource<PPB_Flash_NetConnector_API> enter(host_resource);
- if (enter.failed()) {
- base::ClosePlatformFile(platform_file);
- return;
- }
- FlashNetConnector* object = static_cast<FlashNetConnector*>(enter.object());
- object->ConnectComplete(result, platform_file,
- load_addr_as_string, remote_addr_as_string);
-}
-
-void PPB_Flash_NetConnector_Proxy::OnCompleteCallbackInHost(
- int32_t result,
- ConnectCallbackInfo* info) {
- // Callback must always delete the info.
- scoped_ptr<ConnectCallbackInfo> info_deletor(info);
-
- if (result == PP_OK) {
- dispatcher()->Send(new PpapiMsg_PPBFlashNetConnector_ConnectACK(
- API_ID_PPB_FLASH_NETCONNECTOR,
- info->resource, result,
- dispatcher()->ShareHandleWithRemote(
- static_cast<base::PlatformFile>(info->handle), true),
- NetAddressToString(info->local_addr),
- NetAddressToString(info->remote_addr)));
- } else {
- dispatcher()->Send(new PpapiMsg_PPBFlashNetConnector_ConnectACK(
- API_ID_PPB_FLASH_NETCONNECTOR,
- info->resource, result,
- IPC::InvalidPlatformFileForTransit(), std::string(), std::string()));
- }
-}
-
-} // namespace proxy
-} // namespace ppapi
diff --git a/ppapi/proxy/ppb_flash_net_connector_proxy.h b/ppapi/proxy/ppb_flash_net_connector_proxy.h
deleted file mode 100644
index 14269d9..0000000
--- a/ppapi/proxy/ppb_flash_net_connector_proxy.h
+++ /dev/null
@@ -1,59 +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_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_
-#define PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_
-
-#include "base/platform_file.h"
-#include "ipc/ipc_platform_file.h"
-#include "ppapi/c/pp_instance.h"
-#include "ppapi/proxy/interface_proxy.h"
-#include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
-#include "ppapi/utility/completion_callback_factory.h"
-
-namespace ppapi {
-
-class HostResource;
-
-namespace proxy {
-
-class PPB_Flash_NetConnector_Proxy : public InterfaceProxy {
- public:
- PPB_Flash_NetConnector_Proxy(Dispatcher* dispatcher);
- virtual ~PPB_Flash_NetConnector_Proxy();
-
- static PP_Resource CreateProxyResource(PP_Instance instance);
-
- // InterfaceProxy implementation.
- virtual bool OnMessageReceived(const IPC::Message& msg);
-
- private:
- struct ConnectCallbackInfo;
-
- // Plugin->host message handlers.
- void OnMsgCreate(PP_Instance instance,
- ppapi::HostResource* result);
- void OnMsgConnectTcp(const ppapi::HostResource& resource,
- const std::string& host,
- uint16_t port);
- void OnMsgConnectTcpAddress(const ppapi::HostResource& resource_id,
- const std::string& net_address_as_string);
-
- // Host->plugin message handler.
- void OnMsgConnectACK(const ppapi::HostResource& host_resource,
- int32_t result,
- IPC::PlatformFileForTransit handle,
- const std::string& load_addr_as_string,
- const std::string& remote_addr_as_string);
-
- void OnCompleteCallbackInHost(int32_t result, ConnectCallbackInfo* info);
-
- pp::CompletionCallbackFactory<PPB_Flash_NetConnector_Proxy,
- ProxyNonThreadSafeRefCount> callback_factory_;
-};
-
-} // namespace proxy
-} // namespace ppapi
-
-#endif // PPAPI_PROXY_PPB_FLASH_NET_CONNECTOR_PROXY_H_
diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc
index 5e9cecf..601d314 100644
--- a/ppapi/proxy/resource_creation_proxy.cc
+++ b/ppapi/proxy/resource_creation_proxy.cc
@@ -20,7 +20,6 @@
#include "ppapi/proxy/ppb_file_system_proxy.h"
#include "ppapi/proxy/ppb_flash_menu_proxy.h"
#include "ppapi/proxy/ppb_flash_message_loop_proxy.h"
-#include "ppapi/proxy/ppb_flash_net_connector_proxy.h"
#include "ppapi/proxy/ppb_graphics_2d_proxy.h"
#include "ppapi/proxy/ppb_graphics_3d_proxy.h"
#include "ppapi/proxy/ppb_host_resolver_private_proxy.h"
@@ -162,11 +161,6 @@ PP_Resource ResourceCreationProxy::CreateFlashMessageLoop(
PP_Instance instance) {
return PPB_Flash_MessageLoop_Proxy::CreateProxyResource(instance);
}
-
-PP_Resource ResourceCreationProxy::CreateFlashNetConnector(
- PP_Instance instance) {
- return PPB_Flash_NetConnector_Proxy::CreateProxyResource(instance);
-}
#endif // !defined(OS_NACL)
PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance instance,
diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h
index 60c98fb..9b942ae 100644
--- a/ppapi/proxy/resource_creation_proxy.h
+++ b/ppapi/proxy/resource_creation_proxy.h
@@ -71,7 +71,6 @@ class ResourceCreationProxy : public InterfaceProxy,
virtual PP_Resource CreateFlashMenu(PP_Instance instance,
const PP_Flash_Menu* menu_data) OVERRIDE;
virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) OVERRIDE;
- virtual PP_Resource CreateFlashNetConnector(PP_Instance instance) OVERRIDE;
virtual PP_Resource CreateGraphics2D(PP_Instance pp_instance,
const PP_Size& size,
PP_Bool is_always_opaque) OVERRIDE;
diff --git a/ppapi/shared_impl/api_id.h b/ppapi/shared_impl/api_id.h
index 61af629..ea6ed67 100644
--- a/ppapi/shared_impl/api_id.h
+++ b/ppapi/shared_impl/api_id.h
@@ -30,7 +30,6 @@ enum ApiID {
API_ID_PPB_FLASH_FILE_MODULELOCAL,
API_ID_PPB_FLASH_MENU,
API_ID_PPB_FLASH_MESSAGELOOP,
- API_ID_PPB_FLASH_NETCONNECTOR,
API_ID_PPB_FONT,
API_ID_PPB_GRAPHICS_2D,
API_ID_PPB_GRAPHICS_3D,
diff --git a/ppapi/shared_impl/resource.h b/ppapi/shared_impl/resource.h
index cccc999..86f5168 100644
--- a/ppapi/shared_impl/resource.h
+++ b/ppapi/shared_impl/resource.h
@@ -37,7 +37,6 @@
F(PPB_Find_API) \
F(PPB_Flash_Menu_API) \
F(PPB_Flash_MessageLoop_API) \
- F(PPB_Flash_NetConnector_API) \
F(PPB_Graphics2D_API) \
F(PPB_Graphics3D_API) \
F(PPB_HostResolver_Private_API) \
diff --git a/ppapi/thunk/ppb_flash_net_connector_api.h b/ppapi/thunk/ppb_flash_net_connector_api.h
deleted file mode 100644
index 5bf0198..0000000
--- a/ppapi/thunk/ppb_flash_net_connector_api.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 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_FLASH_NET_CONNECTOR_API_H_
-#define PPAPI_THUNK_PPB_FLASH_NET_CONNECTOR_API_H_
-
-#include "ppapi/c/private/ppb_flash_net_connector.h"
-
-namespace ppapi {
-namespace thunk {
-
-class PPB_Flash_NetConnector_API {
- public:
- virtual ~PPB_Flash_NetConnector_API() {}
-
- virtual int32_t ConnectTcp(const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) = 0;
- virtual int32_t ConnectTcpAddress(const PP_NetAddress_Private* addr,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) = 0;
-};
-
-} // namespace thunk
-} // namespace ppapi
-
-#endif // PPAPI_THUNK_PPB_FLASH_NET_CONNECTOR_API_H_
diff --git a/ppapi/thunk/ppb_flash_net_connector_thunk.cc b/ppapi/thunk/ppb_flash_net_connector_thunk.cc
deleted file mode 100644
index 0be5043..0000000
--- a/ppapi/thunk/ppb_flash_net_connector_thunk.cc
+++ /dev/null
@@ -1,73 +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/private/ppb_flash_net_connector.h"
-#include "ppapi/c/pp_completion_callback.h"
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/thunk.h"
-#include "ppapi/thunk/ppb_flash_net_connector_api.h"
-#include "ppapi/thunk/resource_creation_api.h"
-
-namespace ppapi {
-namespace thunk {
-
-namespace {
-
-typedef EnterResource<PPB_Flash_NetConnector_API> EnterNetConnector;
-
-PP_Resource Create(PP_Instance instance) {
- EnterResourceCreation enter(instance);
- if (enter.failed())
- return 0;
- return enter.functions()->CreateFlashNetConnector(instance);
-}
-
-PP_Bool IsFlashNetConnector(PP_Resource resource) {
- EnterNetConnector enter(resource, false);
- return PP_FromBool(enter.succeeded());
-}
-
-int32_t ConnectTcp(PP_Resource resource,
- const char* host,
- uint16_t port,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) {
- EnterNetConnector enter(resource, callback, true);
- if (enter.failed())
- return enter.retval();
- return enter.SetResult(enter.object()->ConnectTcp(
- host, port, socket_out, local_addr_out, remote_addr_out, callback));
-}
-
-int32_t ConnectTcpAddress(PP_Resource resource,
- const PP_NetAddress_Private* addr,
- PP_FileHandle* socket_out,
- PP_NetAddress_Private* local_addr_out,
- PP_NetAddress_Private* remote_addr_out,
- PP_CompletionCallback callback) {
- EnterNetConnector enter(resource, callback, true);
- if (enter.failed())
- return enter.retval();
- return enter.SetResult(enter.object()->ConnectTcpAddress(
- addr, socket_out, local_addr_out, remote_addr_out, callback));
-}
-
-const PPB_Flash_NetConnector g_ppb_flash_net_connector_thunk = {
- &Create,
- &IsFlashNetConnector,
- &ConnectTcp,
- &ConnectTcpAddress
-};
-
-} // namespace
-
-const PPB_Flash_NetConnector* GetPPB_Flash_NetConnector_0_2_Thunk() {
- return &g_ppb_flash_net_connector_thunk;
-}
-
-} // namespace thunk
-} // namespace ppapi
diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h
index 536c967..5a6ccb5 100644
--- a/ppapi/thunk/resource_creation_api.h
+++ b/ppapi/thunk/resource_creation_api.h
@@ -74,7 +74,6 @@ class ResourceCreationAPI {
virtual PP_Resource CreateFlashMenu(PP_Instance instance,
const PP_Flash_Menu* menu_data) = 0;
virtual PP_Resource CreateFlashMessageLoop(PP_Instance instance) = 0;
- virtual PP_Resource CreateFlashNetConnector(PP_Instance instance) = 0;
virtual PP_Resource CreateGraphics2D(PP_Instance instance,
const PP_Size& size,
PP_Bool is_always_opaque) = 0;
diff --git a/ppapi/thunk/thunk.h b/ppapi/thunk/thunk.h
index 37698b6..e98e71b 100644
--- a/ppapi/thunk/thunk.h
+++ b/ppapi/thunk/thunk.h
@@ -9,7 +9,6 @@
#include "ppapi/c/private/ppb_flash_clipboard.h"
#include "ppapi/c/private/ppb_flash_menu.h"
#include "ppapi/c/private/ppb_flash_message_loop.h"
-#include "ppapi/c/private/ppb_flash_net_connector.h"
#include "ppapi/c/private/ppb_flash_fullscreen.h"
#include "ppapi/c/private/ppb_host_resolver_private.h"
#include "ppapi/c/private/ppb_instance_private.h"
@@ -67,8 +66,6 @@ PPAPI_THUNK_EXPORT const PPB_Flash_Clipboard_3_0*
PPAPI_THUNK_EXPORT const PPB_Flash_Menu_0_2* GetPPB_Flash_Menu_0_2_Thunk();
PPAPI_THUNK_EXPORT const PPB_Flash_MessageLoop_0_1*
GetPPB_Flash_MessageLoop_0_1_Thunk();
-PPAPI_THUNK_EXPORT const PPB_Flash_NetConnector_0_2*
- GetPPB_Flash_NetConnector_0_2_Thunk();
PPAPI_THUNK_EXPORT const PPB_Graphics3DTrusted_1_0*
GetPPB_Graphics3DTrusted_1_0_Thunk();
PPAPI_THUNK_EXPORT const PPB_HostResolver_Private_0_1*