summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 09:39:56 +0000
committerygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 09:39:56 +0000
commit2d011e88f4d4106c1a3a2b4fae4ce2e46bb7d8b3 (patch)
treea1721b6061e1f4cc64350d6d6b61613ec7fe1118 /webkit
parentc1c32c85357f14756247b04b8b5ae41b05bf2e16 (diff)
downloadchromium_src-2d011e88f4d4106c1a3a2b4fae4ce2e46bb7d8b3.zip
chromium_src-2d011e88f4d4106c1a3a2b4fae4ce2e46bb7d8b3.tar.gz
chromium_src-2d011e88f4d4106c1a3a2b4fae4ce2e46bb7d8b3.tar.bz2
Added out-of-process support for server sockets.
BUG=108277 TEST=OutOfProcessPPAPITest.TCPServerSocketPrivate Review URL: http://codereview.chromium.org/9669038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.cc10
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.h9
-rw-r--r--webkit/plugins/ppapi/plugin_delegate.h12
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc3
-rw-r--r--webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.cc12
-rw-r--r--webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h5
6 files changed, 22 insertions, 29 deletions
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc
index c30b845..5f98716 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.cc
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc
@@ -304,17 +304,17 @@ void MockPluginDelegate::UDPSocketClose(uint32 socket_id) {
}
void MockPluginDelegate::TCPServerSocketListen(
- PPB_TCPServerSocket_Private_Impl* socket,
- uint32 temp_socket_id,
+ PP_Resource socket_resource,
const PP_NetAddress_Private& addr,
int32_t backlog) {
}
-void MockPluginDelegate::TCPServerSocketAccept(uint32 real_socket_id) {
+void MockPluginDelegate::TCPServerSocketAccept(uint32 server_socket_id) {
}
-void MockPluginDelegate::TCPServerSocketStopListening(uint32 real_socket_id,
- uint32 temp_socket_id) {
+void MockPluginDelegate::TCPServerSocketStopListening(
+ PP_Resource socket_resource,
+ uint32 socket_id) {
}
void MockPluginDelegate::RegisterHostResolver(
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h
index 15c6311..8a376ea 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.h
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.h
@@ -136,13 +136,12 @@ class MockPluginDelegate : public PluginDelegate {
const std::string& buffer,
const PP_NetAddress_Private& addr);
virtual void UDPSocketClose(uint32 socket_id);
- virtual void TCPServerSocketListen(PPB_TCPServerSocket_Private_Impl* socket,
- uint32 temp_socket_id,
+ virtual void TCPServerSocketListen(PP_Resource socket_resource,
const PP_NetAddress_Private& addr,
int32_t backlog);
- virtual void TCPServerSocketAccept(uint32 real_socket_id);
- virtual void TCPServerSocketStopListening(uint32 real_socket_id,
- uint32 temp_socket_id);
+ virtual void TCPServerSocketAccept(uint32 server_socket_id);
+ virtual void TCPServerSocketStopListening(PP_Resource socket_resource,
+ uint32 socket_id);
virtual void RegisterHostResolver(
::ppapi::PPB_HostResolver_Shared* host_resolver,
uint32 host_resolver_id);
diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h
index f357158..ab388cc 100644
--- a/webkit/plugins/ppapi/plugin_delegate.h
+++ b/webkit/plugins/ppapi/plugin_delegate.h
@@ -23,6 +23,7 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
#include "ui/gfx/size.h"
#include "webkit/fileapi/file_system_types.h"
@@ -88,7 +89,6 @@ class PluginModule;
class PPB_Broker_Impl;
class PPB_Flash_Menu_Impl;
class PPB_Flash_NetConnector_Impl;
-class PPB_TCPServerSocket_Private_Impl;
class PPB_TCPSocket_Private_Impl;
class PPB_UDPSocket_Private_Impl;
@@ -481,13 +481,13 @@ class PluginDelegate {
virtual void UDPSocketClose(uint32 socket_id) = 0;
// For PPB_TCPServerSocket_Private.
- virtual void TCPServerSocketListen(PPB_TCPServerSocket_Private_Impl* socket,
- uint32 temp_socket_id,
+ virtual void TCPServerSocketListen(PP_Resource socket_resource,
const PP_NetAddress_Private& addr,
int32_t backlog) = 0;
- virtual void TCPServerSocketAccept(uint32 real_socket_id) = 0;
- virtual void TCPServerSocketStopListening(uint32 real_socket_id,
- uint32 temp_socket_id) = 0;
+ virtual void TCPServerSocketAccept(uint32 server_socket_id) = 0;
+ virtual void TCPServerSocketStopListening(
+ PP_Resource socket_resource,
+ uint32 socket_id) = 0;
// For PPB_HostResolver_Private.
virtual void RegisterHostResolver(
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 77ba554..3d39f16 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -79,7 +79,6 @@
#include "ppapi/c/private/ppb_network_monitor_private.h"
#include "ppapi/c/private/ppb_pdf.h"
#include "ppapi/c/private/ppb_proxy_private.h"
-#include "ppapi/c/private/ppb_tcp_server_socket_private.h"
#include "ppapi/c/private/ppb_tcp_socket_private.h"
#include "ppapi/c/private/ppb_udp_socket_private.h"
#include "ppapi/c/private/ppb_uma_private.h"
@@ -359,8 +358,6 @@ const void* GetInterface(const char* name) {
return ::ppapi::PPB_OpenGLES2_Shared::GetChromiumMapSubInterface();
if (strcmp(name, PPB_PROXY_PRIVATE_INTERFACE) == 0)
return PPB_Proxy_Impl::GetInterface();
- if (strcmp(name, PPB_TCPSERVERSOCKET_PRIVATE_INTERFACE) == 0)
- return ::ppapi::thunk::GetPPB_TCPServerSocket_Private_0_1_Thunk();
if (strcmp(name, PPB_UMA_PRIVATE_INTERFACE) == 0)
return PPB_UMA_Private_Impl::GetInterface();
if (strcmp(name, PPB_URLLOADERTRUSTED_INTERFACE_0_3) == 0)
diff --git a/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.cc b/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.cc
index 213b4bf..5f023ae 100644
--- a/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.cc
+++ b/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.cc
@@ -32,7 +32,7 @@ PP_Resource PPB_TCPServerSocket_Private_Impl::CreateResource(
void PPB_TCPServerSocket_Private_Impl::OnAcceptCompleted(
bool succeeded,
- uint32 tcp_socket_id,
+ uint32 accepted_socket_id,
const PP_NetAddress_Private& local_addr,
const PP_NetAddress_Private& remote_addr) {
if (!::ppapi::TrackedCallback::IsPending(accept_callback_) ||
@@ -44,7 +44,7 @@ void PPB_TCPServerSocket_Private_Impl::OnAcceptCompleted(
if (succeeded) {
*tcp_socket_buffer_ =
PPB_TCPSocket_Private_Impl::CreateConnectedSocket(pp_instance(),
- tcp_socket_id,
+ accepted_socket_id,
local_addr,
remote_addr);
}
@@ -55,14 +55,13 @@ void PPB_TCPServerSocket_Private_Impl::OnAcceptCompleted(
}
void PPB_TCPServerSocket_Private_Impl::SendListen(
- uint32 temp_socket_id,
const PP_NetAddress_Private& addr,
int32_t backlog) {
PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this);
if (!plugin_delegate)
return;
- plugin_delegate->TCPServerSocketListen(this, temp_socket_id, addr, backlog);
+ plugin_delegate->TCPServerSocketListen(pp_resource(), addr, backlog);
}
void PPB_TCPServerSocket_Private_Impl::SendAccept() {
@@ -70,7 +69,7 @@ void PPB_TCPServerSocket_Private_Impl::SendAccept() {
if (!plugin_delegate)
return;
- plugin_delegate->TCPServerSocketAccept(real_socket_id_);
+ plugin_delegate->TCPServerSocketAccept(socket_id_);
}
void PPB_TCPServerSocket_Private_Impl::SendStopListening() {
@@ -78,8 +77,7 @@ void PPB_TCPServerSocket_Private_Impl::SendStopListening() {
if (!plugin_delegate)
return;
- plugin_delegate->TCPServerSocketStopListening(real_socket_id_,
- temp_socket_id_);
+ plugin_delegate->TCPServerSocketStopListening(pp_resource(), socket_id_);
}
} // namespace ppapi
diff --git a/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h b/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h
index 6533e61..f621e1c 100644
--- a/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h
+++ b/webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h
@@ -18,12 +18,11 @@ class PPB_TCPServerSocket_Private_Impl
virtual void OnAcceptCompleted(
bool succeeded,
- uint32 tcp_socket_id,
+ uint32 accepted_socket_id,
const PP_NetAddress_Private& local_addr,
const PP_NetAddress_Private& remote_addr) OVERRIDE;
- virtual void SendListen(uint32_t temp_socket_id,
- const PP_NetAddress_Private& addr,
+ virtual void SendListen(const PP_NetAddress_Private& addr,
int32_t backlog) OVERRIDE;
virtual void SendAccept() OVERRIDE;
virtual void SendStopListening() OVERRIDE;