diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 19:22:08 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 19:22:08 +0000 |
commit | c761a5fda8cda6efd9e56cb5580e7da37d31dc69 (patch) | |
tree | 2b8e49647ee84096572ee8b75e6767c39e1cffda /webkit/plugins | |
parent | f659c69514aceb0ea27c598c305bf6ead6cf5e34 (diff) | |
download | chromium_src-c761a5fda8cda6efd9e56cb5580e7da37d31dc69.zip chromium_src-c761a5fda8cda6efd9e56cb5580e7da37d31dc69.tar.gz chromium_src-c761a5fda8cda6efd9e56cb5580e7da37d31dc69.tar.bz2 |
Revert 112693 - committed before review was done - Landing 8688002: PPB_TCPSocket_Private/PPB_UDPSocket_Private are exposed to Browser
Review URL: http://codereview.chromium.org/8688002
Patch from Yuri Gorshenin <ygorshenin@chromium.org>.
TBR=dpolukhin@chromium.org
Review URL: http://codereview.chromium.org/8775063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/mock_plugin_delegate.cc | 53 | ||||
-rw-r--r-- | webkit/plugins/ppapi/mock_plugin_delegate.h | 24 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_delegate.h | 30 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_tcp_socket_private_impl.cc | 91 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h | 37 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_udp_socket_private_impl.cc | 71 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_udp_socket_private_impl.h | 34 | ||||
-rw-r--r-- | webkit/plugins/ppapi/resource_creation_impl.cc | 8 |
8 files changed, 4 insertions, 344 deletions
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc index 92093a0..80594fc 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.cc +++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc @@ -232,59 +232,6 @@ int32_t MockPluginDelegate::ConnectTcpAddress( return PP_ERROR_FAILED; } -uint32 MockPluginDelegate::TCPSocketCreate() { - return 0; -} - -void MockPluginDelegate::TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket, - uint32 socket_id, - const std::string& host, - uint16_t port) { -} - -void MockPluginDelegate::TCPSocketConnectWithNetAddress( - PPB_TCPSocket_Private_Impl* socket, - uint32 socket_id, - const PP_NetAddress_Private& addr) { -} - -void MockPluginDelegate::TCPSocketSSLHandshake(uint32 socket_id, - const std::string& server_name, - uint16_t server_port) { -} - -void MockPluginDelegate::TCPSocketRead(uint32 socket_id, - int32_t bytes_to_read) { -} - -void MockPluginDelegate::TCPSocketWrite(uint32 socket_id, - const std::string& buffer) { -} - -void MockPluginDelegate::TCPSocketDisconnect(uint32 socket_id) { -} - -uint32 MockPluginDelegate::UDPSocketCreate() { - return 0; -} - -void MockPluginDelegate::UDPSocketBind(PPB_UDPSocket_Private_Impl* socket, - uint32 socket_id, - const PP_NetAddress_Private& addr) { -} - -void MockPluginDelegate::UDPSocketRecvFrom(uint32 socket_id, - int32_t num_bytes) { -} - -void MockPluginDelegate::UDPSocketSendTo(uint32 socket_id, - const std::string& buffer, - const PP_NetAddress_Private& addr) { -} - -void MockPluginDelegate::UDPSocketClose(uint32 socket_id) { -} - int32_t MockPluginDelegate::ShowContextMenu( PluginInstance* instance, webkit::ppapi::PPB_Flash_Menu_Impl* menu, diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h index b1d3158..3670792 100644 --- a/webkit/plugins/ppapi/mock_plugin_delegate.h +++ b/webkit/plugins/ppapi/mock_plugin_delegate.h @@ -104,30 +104,6 @@ class MockPluginDelegate : public PluginDelegate { 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, - const std::string& host, - uint16_t port); - virtual void TCPSocketConnectWithNetAddress( - PPB_TCPSocket_Private_Impl* socket, - uint32 socket_id, - const PP_NetAddress_Private& addr); - virtual void TCPSocketSSLHandshake(uint32 socket_id, - const std::string& server_name, - uint16_t server_port); - virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read); - virtual void TCPSocketWrite(uint32 socket_id, const std::string& buffer); - virtual void TCPSocketDisconnect(uint32 socket_id); - virtual uint32 UDPSocketCreate(); - virtual void UDPSocketBind(PPB_UDPSocket_Private_Impl* socket, - uint32 socket_id, - const PP_NetAddress_Private& addr); - virtual void UDPSocketRecvFrom(uint32 socket_id, int32_t num_bytes); - virtual void UDPSocketSendTo(uint32 socket_id, - const std::string& buffer, - const PP_NetAddress_Private& addr); - virtual void UDPSocketClose(uint32 socket_id); virtual int32_t ShowContextMenu( PluginInstance* instance, webkit::ppapi::PPB_Flash_Menu_Impl* menu, diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h index c45704e..65506e7 100644 --- a/webkit/plugins/ppapi/plugin_delegate.h +++ b/webkit/plugins/ppapi/plugin_delegate.h @@ -78,8 +78,6 @@ 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; // Virtual interface that the browser implements to implement features for // PPAPI plugins. @@ -408,34 +406,6 @@ class PluginDelegate { 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, - uint32 socket_id, - const std::string& host, - uint16_t port) = 0; - virtual void TCPSocketConnectWithNetAddress( - PPB_TCPSocket_Private_Impl* socket, - uint32 socket_id, - const PP_NetAddress_Private& addr) = 0; - virtual void TCPSocketSSLHandshake(uint32 socket_id, - const std::string& server_name, - uint16_t server_port) = 0; - virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) = 0; - virtual void TCPSocketWrite(uint32 socket_id, const std::string& buffer) = 0; - virtual void TCPSocketDisconnect(uint32 socket_id) = 0; - - // For PPB_UDPSocket_Private. - virtual uint32 UDPSocketCreate() = 0; - virtual void UDPSocketBind(PPB_UDPSocket_Private_Impl* socket, - uint32 socket_id, - const PP_NetAddress_Private& addr) = 0; - virtual void UDPSocketRecvFrom(uint32 socket_id, int32_t num_bytes) = 0; - virtual void UDPSocketSendTo(uint32 socket_id, - const std::string& buffer, - const PP_NetAddress_Private& addr) = 0; - virtual void UDPSocketClose(uint32 socket_id) = 0; - // Show the given context menu at the given position (in the plugin's // coordinates). virtual int32_t ShowContextMenu( diff --git a/webkit/plugins/ppapi/ppb_tcp_socket_private_impl.cc b/webkit/plugins/ppapi/ppb_tcp_socket_private_impl.cc deleted file mode 100644 index 61fc83c..0000000 --- a/webkit/plugins/ppapi/ppb_tcp_socket_private_impl.cc +++ /dev/null @@ -1,91 +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 "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" - -#include "webkit/plugins/ppapi/host_globals.h" -#include "webkit/plugins/ppapi/plugin_delegate.h" -#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" -#include "webkit/plugins/ppapi/resource_helper.h" - -namespace webkit { -namespace ppapi { - -PPB_TCPSocket_Private_Impl::PPB_TCPSocket_Private_Impl( - PP_Instance instance, uint32 socket_id) - : ::ppapi::TCPSocketPrivateImpl(instance, socket_id) { -} - -PPB_TCPSocket_Private_Impl::~PPB_TCPSocket_Private_Impl() { - Disconnect(); -} - -PP_Resource PPB_TCPSocket_Private_Impl::CreateResource(PP_Instance instance) { - PluginInstance* plugin_instance = HostGlobals::Get()->GetInstance(instance); - if (!plugin_instance) - return 0; - - PluginDelegate* plugin_delegate = plugin_instance->delegate(); - uint32 socket_id = plugin_delegate->TCPSocketCreate(); - if (!socket_id) - return 0; - - return (new PPB_TCPSocket_Private_Impl(instance, socket_id))->GetReference(); -} - -void PPB_TCPSocket_Private_Impl::SendConnect(const std::string& host, - uint16_t port) { - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); - if (!plugin_delegate) - return; - - plugin_delegate->TCPSocketConnect(this, socket_id_, host, port); -} - -void PPB_TCPSocket_Private_Impl::SendConnectWithNetAddress( - const PP_NetAddress_Private& addr) { - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); - if (!plugin_delegate) - return; - - plugin_delegate->TCPSocketConnectWithNetAddress(this, socket_id_, addr); -} - -void PPB_TCPSocket_Private_Impl::SendSSLHandshake( - const std::string& server_name, - uint16_t server_port) { - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); - if (!plugin_delegate) - return; - - plugin_delegate->TCPSocketSSLHandshake(socket_id_, server_name, server_port); -} - -void PPB_TCPSocket_Private_Impl::SendRead(int32_t bytes_to_read) { - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); - if (!plugin_delegate) - return; - - plugin_delegate->TCPSocketRead(socket_id_, bytes_to_read); -} - - -void PPB_TCPSocket_Private_Impl::SendWrite(const std::string& buffer) { - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); - if (!plugin_delegate) - return; - - plugin_delegate->TCPSocketWrite(socket_id_, buffer); -} - -void PPB_TCPSocket_Private_Impl::SendDisconnect() { - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); - if (!plugin_delegate) - return; - - plugin_delegate->TCPSocketDisconnect(socket_id_); -} - -} // namespace ppapi -} // namespace webkit diff --git a/webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h b/webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h deleted file mode 100644 index ba86518..0000000 --- a/webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h +++ /dev/null @@ -1,37 +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_TCP_SOCKET_PRIVATE_IMPL_H_ -#define WEBKIT_PLUGINS_PPAPI_PPB_TCP_SOCKET_PRIVATE_IMPL_H_ - -#include "base/compiler_specific.h" -#include "ppapi/shared_impl/private/tcp_socket_private_impl.h" - -namespace webkit { -namespace ppapi { - -class PPB_TCPSocket_Private_Impl : public ::ppapi::TCPSocketPrivateImpl { - public: - static PP_Resource CreateResource(PP_Instance instance); - - virtual void SendConnect(const std::string& host, uint16_t port) OVERRIDE; - virtual void SendConnectWithNetAddress( - const PP_NetAddress_Private& addr) OVERRIDE; - virtual void SendSSLHandshake(const std::string& server_name, - uint16_t server_port) OVERRIDE; - virtual void SendRead(int32_t bytes_to_read) OVERRIDE; - virtual void SendWrite(const std::string& buffer) OVERRIDE; - virtual void SendDisconnect() OVERRIDE; - - private: - PPB_TCPSocket_Private_Impl(PP_Instance instance, uint32 socket_id); - virtual ~PPB_TCPSocket_Private_Impl(); - - DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Impl); -}; - -} // namespace ppapi -} // namespace webkit - -#endif // WEBKIT_PLUGINS_PPAPI_PPB_TCP_SOCKET_PRIVATE_IMPL_H_ diff --git a/webkit/plugins/ppapi/ppb_udp_socket_private_impl.cc b/webkit/plugins/ppapi/ppb_udp_socket_private_impl.cc deleted file mode 100644 index 772746f..0000000 --- a/webkit/plugins/ppapi/ppb_udp_socket_private_impl.cc +++ /dev/null @@ -1,71 +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 "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" - -#include "webkit/plugins/ppapi/host_globals.h" -#include "webkit/plugins/ppapi/plugin_delegate.h" -#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" -#include "webkit/plugins/ppapi/resource_helper.h" - -namespace webkit { -namespace ppapi { - -PPB_UDPSocket_Private_Impl::PPB_UDPSocket_Private_Impl( - PP_Instance instance, uint32 socket_id) - : ::ppapi::UDPSocketPrivateImpl(instance, socket_id) { -} - -PPB_UDPSocket_Private_Impl::~PPB_UDPSocket_Private_Impl() { - Close(); -} - -PP_Resource PPB_UDPSocket_Private_Impl::CreateResource(PP_Instance instance) { - PluginInstance* plugin_instance = HostGlobals::Get()->GetInstance(instance); - if (!plugin_instance) - return 0; - - PluginDelegate* pluign_delegate = plugin_instance->delegate(); - uint32 socket_id = pluign_delegate->UDPSocketCreate(); - if (!socket_id) - return 0; - - return (new PPB_UDPSocket_Private_Impl(instance, socket_id))->GetReference(); -} - -void PPB_UDPSocket_Private_Impl::SendBind(const PP_NetAddress_Private& addr) { - PluginDelegate* pluign_delegate = ResourceHelper::GetPluginDelegate(this); - if (!pluign_delegate) - return; - - pluign_delegate->UDPSocketBind(this, socket_id_, addr); -} - -void PPB_UDPSocket_Private_Impl::SendRecvFrom(int32_t num_bytes) { - PluginDelegate* pluign_delegate = ResourceHelper::GetPluginDelegate(this); - if (!pluign_delegate) - return; - - pluign_delegate->UDPSocketRecvFrom(socket_id_, num_bytes); -} - -void PPB_UDPSocket_Private_Impl::SendSendTo(const std::string& buffer, - const PP_NetAddress_Private& addr) { - PluginDelegate* pluign_delegate = ResourceHelper::GetPluginDelegate(this); - if (!pluign_delegate) - return; - - pluign_delegate->UDPSocketSendTo(socket_id_, buffer, addr); -} - -void PPB_UDPSocket_Private_Impl::SendClose() { - PluginDelegate* pluign_delegate = ResourceHelper::GetPluginDelegate(this); - if (!pluign_delegate) - return; - - pluign_delegate->UDPSocketClose(socket_id_); -} - -} // namespace ppapi -} // namespace webkit diff --git a/webkit/plugins/ppapi/ppb_udp_socket_private_impl.h b/webkit/plugins/ppapi/ppb_udp_socket_private_impl.h deleted file mode 100644 index 4dbe42d..0000000 --- a/webkit/plugins/ppapi/ppb_udp_socket_private_impl.h +++ /dev/null @@ -1,34 +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_UDP_SOCKET_PRIVATE_IMPL_H_ -#define WEBKIT_PLUGINS_PPAPI_PPB_UDP_SOCKET_PRIVATE_IMPL_H_ - -#include "base/compiler_specific.h" -#include "ppapi/shared_impl/private/udp_socket_private_impl.h" - -namespace webkit { -namespace ppapi { - -class PPB_UDPSocket_Private_Impl : public ::ppapi::UDPSocketPrivateImpl { - public: - static PP_Resource CreateResource(PP_Instance instance); - - virtual void SendBind(const PP_NetAddress_Private& addr) OVERRIDE; - virtual void SendRecvFrom(int32_t num_bytes) OVERRIDE; - virtual void SendSendTo(const std::string& buffer, - const PP_NetAddress_Private& addr) OVERRIDE; - virtual void SendClose() OVERRIDE; - - private: - PPB_UDPSocket_Private_Impl(PP_Instance instance, uint32 socket_id); - virtual ~PPB_UDPSocket_Private_Impl(); - - DISALLOW_COPY_AND_ASSIGN(PPB_UDPSocket_Private_Impl); -}; - -} // namespace ppapi -} // namespace webkit - -#endif // WEBKIT_PLUGINS_PPAPI_PPB_UDP_SOCKET_PRIVATE_IMPL_H_ diff --git a/webkit/plugins/ppapi/resource_creation_impl.cc b/webkit/plugins/ppapi/resource_creation_impl.cc index d2b57f3..ace20f8 100644 --- a/webkit/plugins/ppapi/resource_creation_impl.cc +++ b/webkit/plugins/ppapi/resource_creation_impl.cc @@ -25,9 +25,7 @@ #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" #include "webkit/plugins/ppapi/ppb_image_data_impl.h" #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" -#include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" #include "webkit/plugins/ppapi/ppb_transport_impl.h" -#include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" #include "webkit/plugins/ppapi/ppb_video_capture_impl.h" @@ -235,7 +233,8 @@ PP_Resource ResourceCreationImpl::CreateScrollbar(PP_Instance instance, } PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { - return PPB_TCPSocket_Private_Impl::CreateResource(instance); + // Creating TCP socket resource at the renderer side is not supported. + return 0; } PP_Resource ResourceCreationImpl::CreateTransport(PP_Instance instance, @@ -247,7 +246,8 @@ PP_Resource ResourceCreationImpl::CreateTransport(PP_Instance instance, } PP_Resource ResourceCreationImpl::CreateUDPSocketPrivate(PP_Instance instance) { - return PPB_UDPSocket_Private_Impl::CreateResource(instance); + // Creating UDP socket resource at the renderer side is not supported. + return 0; } PP_Resource ResourceCreationImpl::CreateURLLoader(PP_Instance instance) { |