diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-28 18:14:00 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-28 18:14:00 +0000 |
commit | aa24087660b005d3d5379eadd0a98d80ed7a16e8 (patch) | |
tree | 7c061084c4a5299b43525eb751d06b82724e11ff /webkit | |
parent | 3ca185cdb039551e08443c671a5d3a78cbc6454c (diff) | |
download | chromium_src-aa24087660b005d3d5379eadd0a98d80ed7a16e8.zip chromium_src-aa24087660b005d3d5379eadd0a98d80ed7a16e8.tar.gz chromium_src-aa24087660b005d3d5379eadd0a98d80ed7a16e8.tar.bz2 |
Remove PPB_Flash_NetConnector and ENABLE_FLAPPER_HACKS.
PPB_Flash_NetConnector has been superseded by less hacky and more general
interfaces. ENABLE_FLAPPER_HACKS only enabled PPB_Flash_NetConnector.
TEST=builds (and still passes PPAPI tests)
TBR=darin@chromium.org
Review URL: http://codereview.chromium.org/9836131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/mock_plugin_delegate.cc | 13 | ||||
-rw-r--r-- | webkit/plugins/ppapi/mock_plugin_delegate.h | 7 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_delegate.h | 9 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc | 132 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_flash_net_connector_impl.h | 66 | ||||
-rw-r--r-- | webkit/plugins/ppapi/resource_creation_impl.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/resource_creation_impl.h | 1 |
9 files changed, 0 insertions, 242 deletions
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index a5a3743..987eb2c 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -283,8 +283,6 @@ '../plugins/ppapi/ppb_flash_menu_impl.h', '../plugins/ppapi/ppb_flash_message_loop_impl.cc', '../plugins/ppapi/ppb_flash_message_loop_impl.h', - '../plugins/ppapi/ppb_flash_net_connector_impl.cc', - '../plugins/ppapi/ppb_flash_net_connector_impl.h', '../plugins/ppapi/ppb_gpu_blacklist_private_impl.cc', '../plugins/ppapi/ppb_gpu_blacklist_private_impl.h', '../plugins/ppapi/ppb_graphics_2d_impl.cc', diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc index 44b815e..ab55d97 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.cc +++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc @@ -234,19 +234,6 @@ MockPluginDelegate::GetFileThreadMessageLoopProxy() { return scoped_refptr<base::MessageLoopProxy>(); } -int32_t MockPluginDelegate::ConnectTcp( - webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, - const char* host, - uint16_t port) { - return PP_ERROR_FAILED; -} - -int32_t MockPluginDelegate::ConnectTcpAddress( - webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, - const PP_NetAddress_Private* addr) { - return PP_ERROR_FAILED; -} - uint32 MockPluginDelegate::TCPSocketCreate() { return 0; } diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h index 214a868..d20b05e 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.h +++ b/webkit/plugins/ppapi/mock_plugin_delegate.h @@ -104,13 +104,6 @@ class MockPluginDelegate : public PluginDelegate { FilePath* platform_path); virtual scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy(); - virtual int32_t ConnectTcp( - webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, - const char* host, - uint16_t port); - virtual int32_t ConnectTcpAddress( - webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, - const PP_NetAddress_Private* addr); virtual uint32 TCPSocketCreate(); virtual void TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket, uint32 socket_id, diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h index 8b6f443..1003a6fb 100644 --- a/webkit/plugins/ppapi/plugin_delegate.h +++ b/webkit/plugins/ppapi/plugin_delegate.h @@ -88,7 +88,6 @@ class PluginInstance; class PluginModule; class PPB_Broker_Impl; class PPB_Flash_Menu_Impl; -class PPB_Flash_NetConnector_Impl; class PPB_TCPSocket_Private_Impl; class PPB_UDPSocket_Private_Impl; @@ -459,14 +458,6 @@ class PluginDelegate { virtual scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy() = 0; - virtual int32_t ConnectTcp( - webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, - const char* host, - uint16_t port) = 0; - virtual int32_t ConnectTcpAddress( - webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, - const PP_NetAddress_Private* addr) = 0; - // For PPB_TCPSocket_Private. virtual uint32 TCPSocketCreate() = 0; virtual void TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket, diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index e485905..0d640b1 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -111,7 +111,6 @@ #include "webkit/plugins/ppapi/ppb_flash_file_impl.h" #include "webkit/plugins/ppapi/ppb_flash_impl.h" #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" -#include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" #include "webkit/plugins/ppapi/ppb_gpu_blacklist_private_impl.h" #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" #include "webkit/plugins/ppapi/ppb_image_data_impl.h" @@ -374,11 +373,6 @@ const void* GetInterface(const char* name) { if (strcmp(name, PPB_VAR_ARRAY_BUFFER_INTERFACE_1_0) == 0) return ::ppapi::PPB_Var_Shared::GetVarArrayBufferInterface1_0(); -#ifdef ENABLE_FLAPPER_HACKS - if (strcmp(name, PPB_FLASH_NETCONNECTOR_INTERFACE) == 0) - return ::ppapi::thunk::GetPPB_Flash_NetConnector_0_2_Thunk(); -#endif // ENABLE_FLAPPER_HACKS - // Only support the testing interface when the command line switch is // specified. This allows us to prevent people from (ab)using this interface // in production code. diff --git a/webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc b/webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc deleted file mode 100644 index b3db5ac..0000000 --- a/webkit/plugins/ppapi/ppb_flash_net_connector_impl.cc +++ /dev/null @@ -1,132 +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 "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" - -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/c/private/ppb_flash_net_connector.h" -#include "webkit/plugins/ppapi/common.h" -#include "webkit/plugins/ppapi/plugin_delegate.h" -#include "webkit/plugins/ppapi/plugin_module.h" -#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" -#include "webkit/plugins/ppapi/resource_helper.h" - -using ppapi::thunk::PPB_Flash_NetConnector_API; -using ppapi::TrackedCallback; - -namespace webkit { -namespace ppapi { - -PPB_Flash_NetConnector_Impl::PPB_Flash_NetConnector_Impl(PP_Instance instance) - : Resource(::ppapi::OBJECT_IS_IMPL, instance), - socket_out_(NULL), - local_addr_out_(NULL), - remote_addr_out_(NULL) { -} - -PPB_Flash_NetConnector_Impl::~PPB_Flash_NetConnector_Impl() { -} - -PPB_Flash_NetConnector_API* - PPB_Flash_NetConnector_Impl::AsPPB_Flash_NetConnector_API() { - return this; -} - -int32_t PPB_Flash_NetConnector_Impl::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) { - // |socket_out| is not optional. - if (!socket_out) - return PP_ERROR_BADARGUMENT; - - if (!callback.func) - return PP_ERROR_BLOCKS_MAIN_THREAD; - - if (TrackedCallback::IsPending(callback_)) - return PP_ERROR_INPROGRESS; - - PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); - if (!plugin_instance) - return false; - int32_t rv = plugin_instance->delegate()->ConnectTcp(this, host, port); - if (rv == PP_OK_COMPLETIONPENDING) { - // Record callback and output buffers. - callback_ = new TrackedCallback(this, callback); - socket_out_ = socket_out; - local_addr_out_ = local_addr_out; - remote_addr_out_ = remote_addr_out; - } else { - // This should never be completed synchronously successfully. - DCHECK_NE(rv, PP_OK); - } - return rv; -} - -int32_t PPB_Flash_NetConnector_Impl::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) { - // |socket_out| is not optional. - if (!socket_out) - return PP_ERROR_BADARGUMENT; - - if (!callback.func) - return PP_ERROR_BLOCKS_MAIN_THREAD; - - if (TrackedCallback::IsPending(callback_)) - return PP_ERROR_INPROGRESS; - - PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); - if (!plugin_instance) - return false; - int32_t rv = plugin_instance->delegate()->ConnectTcpAddress(this, addr); - if (rv == PP_OK_COMPLETIONPENDING) { - // Record callback and output buffers. - callback_ = new TrackedCallback(this, callback); - socket_out_ = socket_out; - local_addr_out_ = local_addr_out; - remote_addr_out_ = remote_addr_out; - } else { - // This should never be completed synchronously successfully. - DCHECK_NE(rv, PP_OK); - } - return rv; -} - -void PPB_Flash_NetConnector_Impl::CompleteConnectTcp( - PP_FileHandle socket, - const PP_NetAddress_Private& local_addr, - const PP_NetAddress_Private& remote_addr) { - int32_t rv = PP_ERROR_ABORTED; - if (!callback_->aborted()) { - CHECK(!callback_->completed()); - - // Write output data. - *socket_out_ = socket; - if (socket != PP_kInvalidFileHandle) { - if (local_addr_out_) - *local_addr_out_ = local_addr; - if (remote_addr_out_) - *remote_addr_out_ = remote_addr; - rv = PP_OK; - } else { - rv = PP_ERROR_FAILED; - } - } - - socket_out_ = NULL; - local_addr_out_ = NULL; - remote_addr_out_ = NULL; - TrackedCallback::ClearAndRun(&callback_, rv); -} - -} // namespace ppapi -} // namespace webkit - diff --git a/webkit/plugins/ppapi/ppb_flash_net_connector_impl.h b/webkit/plugins/ppapi/ppb_flash_net_connector_impl.h deleted file mode 100644 index 801ba2e..0000000 --- a/webkit/plugins/ppapi/ppb_flash_net_connector_impl.h +++ /dev/null @@ -1,66 +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 WEBKIT_PLUGINS_PPAPI_PPB_FLASH_NET_CONNECTOR_IMPL_H_ -#define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_NET_CONNECTOR_IMPL_H_ - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" -#include "ppapi/c/private/ppb_flash_net_connector.h" -#include "ppapi/shared_impl/resource.h" -#include "ppapi/shared_impl/tracked_callback.h" -#include "ppapi/thunk/ppb_flash_net_connector_api.h" -#include "webkit/plugins/webkit_plugins_export.h" - -namespace webkit { -namespace ppapi { - -class PPB_Flash_NetConnector_Impl - : public ::ppapi::Resource, - public ::ppapi::thunk::PPB_Flash_NetConnector_API { - public: - explicit PPB_Flash_NetConnector_Impl(PP_Instance instance); - virtual ~PPB_Flash_NetConnector_Impl(); - - // Resource override. - virtual ::ppapi::thunk::PPB_Flash_NetConnector_API* - AsPPB_Flash_NetConnector_API() OVERRIDE; - - // PPB_Flash_NetConnector 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; - - // Called to complete |ConnectTcp()| and |ConnectTcpAddress()|. - WEBKIT_PLUGINS_EXPORT void CompleteConnectTcp( - PP_FileHandle socket, - const PP_NetAddress_Private& local_addr, - const PP_NetAddress_Private& remote_addr); - - private: - // Any pending callback (for |ConnectTcp()| or |ConnectTcpAddress()|). - scoped_refptr< ::ppapi::TrackedCallback> callback_; - - // Output buffers to be filled in when the callback is completed successfully - // (|{local,remote}_addr_out| are optional and may be null). - PP_FileHandle* socket_out_; - PP_NetAddress_Private* local_addr_out_; - PP_NetAddress_Private* remote_addr_out_; - - DISALLOW_COPY_AND_ASSIGN(PPB_Flash_NetConnector_Impl); -}; - -} // namespace ppapi -} // namespace webkit - -#endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_NET_CONNECTOR_IMPL_H_ diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc index e1b540c..d701b9d 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.cc +++ b/webkit/plugins/ppapi/resource_creation_impl.cc @@ -22,7 +22,6 @@ #include "webkit/plugins/ppapi/ppb_file_system_impl.h" #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" -#include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" #include "webkit/plugins/ppapi/ppb_host_resolver_private_impl.h" @@ -154,11 +153,6 @@ PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { return PPB_Flash_MessageLoop_Impl::Create(instance); } -PP_Resource ResourceCreationImpl::CreateFlashNetConnector( - PP_Instance instance) { - return (new PPB_Flash_NetConnector_Impl(instance))->GetReference(); -} - PP_Resource ResourceCreationImpl::CreateGraphics2D( PP_Instance instance, const PP_Size& size, diff --git a/webkit/plugins/ppapi/resource_creation_impl.h b/webkit/plugins/ppapi/resource_creation_impl.h index b918cda..439bd5c 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.h +++ b/webkit/plugins/ppapi/resource_creation_impl.h @@ -58,7 +58,6 @@ class ResourceCreationImpl : public ::ppapi::FunctionGroupBase, 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; |