Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Unified Diff: content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc

Issue 21192002: Remove more methods from PluginDelegate. Some I moved the implementationto the callers. For others,… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698