| Index: content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc
|
| ===================================================================
|
| --- content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc (revision 214249)
|
| +++ content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc (working copy)
|
| @@ -6,9 +6,10 @@
|
|
|
| #include "base/logging.h"
|
| #include "content/renderer/pepper/host_globals.h"
|
| -#include "content/renderer/pepper/plugin_delegate.h"
|
| +#include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
|
| #include "content/renderer/pepper/ppb_tcp_socket_private_impl.h"
|
| #include "content/renderer/pepper/resource_helper.h"
|
| +#include "ppapi/proxy/ppapi_messages.h"
|
|
|
| namespace content {
|
|
|
| @@ -54,27 +55,39 @@
|
| void PPB_TCPServerSocket_Private_Impl::SendListen(
|
| const PP_NetAddress_Private& addr,
|
| int32_t backlog) {
|
| - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this);
|
| + PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate();
|
| if (!plugin_delegate)
|
| return;
|
|
|
| - plugin_delegate->TCPServerSocketListen(pp_resource(), addr, backlog);
|
| + plugin_delegate->Send(new PpapiHostMsg_PPBTCPServerSocket_Listen(
|
| + plugin_delegate->routing_id(), 0, pp_resource(), addr, backlog));
|
| }
|
|
|
| void PPB_TCPServerSocket_Private_Impl::SendAccept() {
|
| - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this);
|
| + PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate();
|
| if (!plugin_delegate)
|
| return;
|
|
|
| - plugin_delegate->TCPServerSocketAccept(socket_id_);
|
| + plugin_delegate->Send(new PpapiHostMsg_PPBTCPServerSocket_Accept(
|
| + plugin_delegate->routing_id(), socket_id_));
|
| }
|
|
|
| void PPB_TCPServerSocket_Private_Impl::SendStopListening() {
|
| - PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this);
|
| + PepperPluginDelegateImpl* plugin_delegate = GetPluginDelegate();
|
| if (!plugin_delegate)
|
| return;
|
|
|
| - plugin_delegate->TCPServerSocketStopListening(pp_resource(), socket_id_);
|
| + if (socket_id_ != 0) {
|
| + plugin_delegate->Send(new PpapiHostMsg_PPBTCPServerSocket_Destroy(
|
| + socket_id_));
|
| + plugin_delegate->TCPServerSocketStopListening(socket_id_);
|
| + }
|
| }
|
|
|
| +PepperPluginDelegateImpl*
|
| + PPB_TCPServerSocket_Private_Impl::GetPluginDelegate() {
|
| + return static_cast<PepperPluginDelegateImpl*>(
|
| + ResourceHelper::GetPluginDelegate(this));
|
| +}
|
| +
|
| } // namespace content
|
|
|