summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-21 15:21:56 +0000
committerygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-21 15:21:56 +0000
commit9e14121e3f252f278ee8d05cbb51d0e45a735603 (patch)
treed3eb50e71cf9f5a95bda1be5abeb47dc383aa6c6 /content/renderer
parenta69876c076c218567d4059a8a27ca63d2a1f1af2 (diff)
downloadchromium_src-9e14121e3f252f278ee8d05cbb51d0e45a735603.zip
chromium_src-9e14121e3f252f278ee8d05cbb51d0e45a735603.tar.gz
chromium_src-9e14121e3f252f278ee8d05cbb51d0e45a735603.tar.bz2
PPB_UDPSocket_Private is switched to the new Pepper proxy.
BUG=164370 TEST=browser_tests:*UDPSocketPrivate* Review URL: https://chromiumcodereview.appspot.com/11441012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/pepper/pepper_in_process_resource_creation.cc9
-rw-r--r--content/renderer/pepper/pepper_in_process_resource_creation.h1
-rw-r--r--content/renderer/pepper/pepper_plugin_delegate_impl.cc92
-rw-r--r--content/renderer/pepper/pepper_plugin_delegate_impl.h32
4 files changed, 9 insertions, 125 deletions
diff --git a/content/renderer/pepper/pepper_in_process_resource_creation.cc b/content/renderer/pepper/pepper_in_process_resource_creation.cc
index 5976b68..a71e83f 100644
--- a/content/renderer/pepper/pepper_in_process_resource_creation.cc
+++ b/content/renderer/pepper/pepper_in_process_resource_creation.cc
@@ -5,11 +5,12 @@
#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "base/bind.h"
+#include "base/logging.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
-#include "content/renderer/render_view_impl.h"
#include "content/renderer/pepper/pepper_in_process_router.h"
#include "content/renderer/pepper/renderer_ppapi_host_impl.h"
+#include "content/renderer/render_view_impl.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
#include "ppapi/host/ppapi_host.h"
@@ -92,6 +93,12 @@ PP_Resource PepperInProcessResourceCreation::CreatePrinting(
instance))->GetReference();
}
+PP_Resource PepperInProcessResourceCreation::CreateUDPSocketPrivate(
+ PP_Instance instance) {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
PP_Resource PepperInProcessResourceCreation::CreateURLRequestInfo(
PP_Instance instance,
const ::ppapi::URLRequestInfoData& data) {
diff --git a/content/renderer/pepper/pepper_in_process_resource_creation.h b/content/renderer/pepper/pepper_in_process_resource_creation.h
index 93df2af..6d51d12 100644
--- a/content/renderer/pepper/pepper_in_process_resource_creation.h
+++ b/content/renderer/pepper/pepper_in_process_resource_creation.h
@@ -56,6 +56,7 @@ class PepperInProcessResourceCreation
PP_Bool is_always_opaque) OVERRIDE;
virtual PP_Resource CreatePrinting(
PP_Instance instance) OVERRIDE;
+ virtual PP_Resource CreateUDPSocketPrivate(PP_Instance instance) OVERRIDE;
virtual PP_Resource CreateURLRequestInfo(
PP_Instance instance,
const ::ppapi::URLRequestInfoData& data) OVERRIDE;
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 156c969..69fc48e 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -87,7 +87,6 @@
#include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
#include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h"
#include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h"
-#include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h"
#include "webkit/plugins/ppapi/resource_helper.h"
#include "webkit/plugins/webplugininfo.h"
@@ -1188,58 +1187,6 @@ void PepperPluginDelegateImpl::RegisterTCPSocket(
tcp_sockets_.AddWithID(socket, socket_id);
}
-uint32 PepperPluginDelegateImpl::UDPSocketCreate() {
- uint32 socket_id = 0;
- render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Create(
- render_view_->routing_id(), 0, &socket_id));
- return socket_id;
-}
-
-void PepperPluginDelegateImpl::UDPSocketSetBoolSocketFeature(
- webkit::ppapi::PPB_UDPSocket_Private_Impl* socket,
- uint32 socket_id,
- int32_t name,
- bool value) {
- render_view_->Send(
- new PpapiHostMsg_PPBUDPSocket_SetBoolSocketFeature(
- render_view_->routing_id(), socket_id, name, value));
-}
-
-void PepperPluginDelegateImpl::UDPSocketBind(
- webkit::ppapi::PPB_UDPSocket_Private_Impl* socket,
- uint32 socket_id,
- const PP_NetAddress_Private& addr) {
- if (!udp_sockets_.Lookup(socket_id))
- udp_sockets_.AddWithID(socket, socket_id);
- render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Bind(
- render_view_->routing_id(), socket_id, addr));
-}
-
-void PepperPluginDelegateImpl::UDPSocketRecvFrom(uint32 socket_id,
- int32_t num_bytes) {
- DCHECK(udp_sockets_.Lookup(socket_id));
- render_view_->Send(
- new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id, num_bytes));
-}
-
-void PepperPluginDelegateImpl::UDPSocketSendTo(
- uint32 socket_id,
- const std::string& buffer,
- const PP_NetAddress_Private& net_addr) {
- DCHECK(udp_sockets_.Lookup(socket_id));
- render_view_->Send(
- new PpapiHostMsg_PPBUDPSocket_SendTo(render_view_->routing_id(),
- socket_id, buffer, net_addr));
-}
-
-void PepperPluginDelegateImpl::UDPSocketClose(uint32 socket_id) {
- // There are no DCHECK(udp_sockets_.Lookup(socket_id)) because it
- // can be called before UDPSocketBind is called.
- render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Close(socket_id));
- if (udp_sockets_.Lookup(socket_id))
- udp_sockets_.Remove(socket_id);
-}
-
void PepperPluginDelegateImpl::TCPServerSocketListen(
PP_Resource socket_resource,
const PP_NetAddress_Private& addr,
@@ -1484,10 +1431,6 @@ bool PepperPluginDelegateImpl::OnMessageReceived(const IPC::Message& message) {
OnTCPSocketSSLHandshakeACK)
IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK)
IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK)
- IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK)
- IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_RecvFromACK,
- OnUDPSocketRecvFromACK)
- IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK, OnUDPSocketSendToACK)
IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_ListenACK,
OnTCPServerSocketListenACK)
IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_AcceptACK,
@@ -1550,41 +1493,6 @@ void PepperPluginDelegateImpl::OnTCPSocketWriteACK(uint32 plugin_dispatcher_id,
socket->OnWriteCompleted(succeeded, bytes_written);
}
-void PepperPluginDelegateImpl::OnUDPSocketBindACK(
- uint32 plugin_dispatcher_id,
- uint32 socket_id,
- bool succeeded,
- const PP_NetAddress_Private& addr) {
- webkit::ppapi::PPB_UDPSocket_Private_Impl* socket =
- udp_sockets_.Lookup(socket_id);
- if (socket)
- socket->OnBindCompleted(succeeded, addr);
- if (!succeeded)
- udp_sockets_.Remove(socket_id);
-}
-
-void PepperPluginDelegateImpl::OnUDPSocketRecvFromACK(
- uint32 plugin_dispatcher_id,
- uint32 socket_id,
- bool succeeded,
- const std::string& data,
- const PP_NetAddress_Private& remote_addr) {
- webkit::ppapi::PPB_UDPSocket_Private_Impl* socket =
- udp_sockets_.Lookup(socket_id);
- if (socket)
- socket->OnRecvFromCompleted(succeeded, data, remote_addr);
-}
-
-void PepperPluginDelegateImpl::OnUDPSocketSendToACK(uint32 plugin_dispatcher_id,
- uint32 socket_id,
- bool succeeded,
- int32_t bytes_written) {
- webkit::ppapi::PPB_UDPSocket_Private_Impl* socket =
- udp_sockets_.Lookup(socket_id);
- if (socket)
- socket->OnSendToCompleted(succeeded, bytes_written);
-}
-
void PepperPluginDelegateImpl::OnTCPServerSocketListenACK(
uint32 plugin_dispatcher_id,
PP_Resource socket_resource,
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.h b/content/renderer/pepper/pepper_plugin_delegate_impl.h
index 3d206d7..8ced3eb 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.h
@@ -23,7 +23,6 @@
#include "ppapi/shared_impl/private/ppb_host_resolver_shared.h"
#include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h"
#include "ppapi/shared_impl/private/tcp_socket_private_impl.h"
-#include "ppapi/shared_impl/private/udp_socket_private_impl.h"
#include "ui/base/ime/text_input_type.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
@@ -270,22 +269,6 @@ class PepperPluginDelegateImpl
virtual void RegisterTCPSocket(
webkit::ppapi::PPB_TCPSocket_Private_Impl* socket,
uint32 socket_id) OVERRIDE;
- virtual uint32 UDPSocketCreate() OVERRIDE;
- virtual void UDPSocketSetBoolSocketFeature(
- webkit::ppapi::PPB_UDPSocket_Private_Impl* socket,
- uint32 socket_id,
- int32_t name,
- bool value) OVERRIDE;
- virtual void UDPSocketBind(
- webkit::ppapi::PPB_UDPSocket_Private_Impl* socket,
- uint32 socket_id,
- const PP_NetAddress_Private& addr) OVERRIDE;
- virtual void UDPSocketRecvFrom(uint32 socket_id,
- int32_t num_bytes) OVERRIDE;
- virtual void UDPSocketSendTo(uint32 socket_id,
- const std::string& buffer,
- const PP_NetAddress_Private& addr) OVERRIDE;
- virtual void UDPSocketClose(uint32 socket_id) OVERRIDE;
virtual void TCPServerSocketListen(
PP_Resource socket_resource,
const PP_NetAddress_Private& addr,
@@ -360,19 +343,6 @@ class PepperPluginDelegateImpl
uint32 socket_id,
bool succeeded,
int32_t bytes_written);
- void OnUDPSocketBindACK(uint32 plugin_dispatcher_id,
- uint32 socket_id,
- bool succeeded,
- const PP_NetAddress_Private& addr);
- void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id,
- uint32 socket_id,
- bool succeeded,
- int32_t bytes_written);
- void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id,
- uint32 socket_id,
- bool succeeded,
- const std::string& data,
- const PP_NetAddress_Private& addr);
void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id,
PP_Resource socket_resource,
uint32 socket_id,
@@ -441,8 +411,6 @@ class PepperPluginDelegateImpl
IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_;
- IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_;
-
IDMap<ppapi::PPB_TCPServerSocket_Shared> tcp_server_sockets_;
IDMap<ppapi::PPB_HostResolver_Shared> host_resolvers_;