From 0eb0e874e21ae0ce8bcf0764b5168910d6dfae9b Mon Sep 17 00:00:00 2001 From: "yzshen@chromium.org" Date: Wed, 11 Dec 2013 03:51:40 +0000 Subject: [PATCH] Pepper: Remove DispatcherMessageListener Now all resources that require communication between browser and plugin have been moved to the new design. This is not needed anymore. BUG=None TEST=None Review URL: https://codereview.chromium.org/111893003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240004 0039d316-1c4b-4281-b951-d872f2087c98 --- content/ppapi_plugin/ppapi_thread.cc | 33 +--------------------------- content/ppapi_plugin/ppapi_thread.h | 19 ---------------- ppapi/shared_impl/api_id.h | 1 - 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index a29a63903b4e7e..f0db1561447c5c 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -37,7 +37,6 @@ #include "ppapi/proxy/interface_list.h" #include "ppapi/proxy/plugin_globals.h" #include "ppapi/proxy/ppapi_messages.h" -#include "ppapi/shared_impl/api_id.h" #include "third_party/WebKit/public/web/WebKit.h" #include "ui/base/ui_base_switches.h" @@ -60,37 +59,12 @@ namespace content { typedef int32_t (*InitializeBrokerFunc) (PP_ConnectInstance_Func* connect_instance_func); -PpapiThread::DispatcherMessageListener::DispatcherMessageListener( - PpapiThread* owner) : owner_(owner) { -} - -PpapiThread::DispatcherMessageListener::~DispatcherMessageListener() { -} - -bool PpapiThread::DispatcherMessageListener::OnMessageReceived( - const IPC::Message& msg) { - // The first parameter should be a plugin dispatcher ID. - PickleIterator iter(msg); - uint32 id = 0; - if (!msg.ReadUInt32(&iter, &id)) { - NOTREACHED(); - return false; - } - std::map::iterator dispatcher = - owner_->plugin_dispatchers_.find(id); - if (dispatcher != owner_->plugin_dispatchers_.end()) - return dispatcher->second->OnMessageReceived(msg); - - return false; -} - PpapiThread::PpapiThread(const CommandLine& command_line, bool is_broker) : is_broker_(is_broker), connect_instance_func_(NULL), local_pp_module_( base::RandInt(0, std::numeric_limits::max())), - next_plugin_dispatcher_id_(1), - dispatcher_message_listener_(this) { + next_plugin_dispatcher_id_(1) { ppapi::proxy::PluginGlobals* globals = ppapi::proxy::PluginGlobals::Get(); globals->set_plugin_proxy_delegate(this); globals->set_command_line( @@ -98,11 +72,6 @@ PpapiThread::PpapiThread(const CommandLine& command_line, bool is_broker) webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl); blink::initialize(webkit_platform_support_.get()); - - // Register interfaces that expect messages from the browser process. Please - // note that only those InterfaceProxy-based ones require registration. - AddRoute(ppapi::API_ID_PPB_HOSTRESOLVER_PRIVATE, - &dispatcher_message_listener_); } PpapiThread::~PpapiThread() { diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h index d1ca5501dfb205..8a06c4d1f84612 100644 --- a/content/ppapi_plugin/ppapi_thread.h +++ b/content/ppapi_plugin/ppapi_thread.h @@ -16,7 +16,6 @@ #include "build/build_config.h" #include "content/child/child_thread.h" #include "content/public/common/pepper_plugin_info.h" -#include "ipc/ipc_listener.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/trusted/ppp_broker.h" #include "ppapi/proxy/connection.h" @@ -62,22 +61,6 @@ class PpapiThread : public ChildThread, LOAD_RESULT_MAX // Boundary value for UMA_HISTOGRAM_ENUMERATION. }; - // This class finds the target PluginDispatcher for each message it receives - // and forwards the message. - class DispatcherMessageListener : public IPC::Listener { - public: - explicit DispatcherMessageListener(PpapiThread* owner); - virtual ~DispatcherMessageListener(); - - // IPC::Listener implementation. - virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; - - private: - PpapiThread* owner_; - - DISALLOW_COPY_AND_ASSIGN(DispatcherMessageListener); - }; - // ChildThread overrides. virtual bool Send(IPC::Message* msg) OVERRIDE; virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; @@ -173,8 +156,6 @@ class PpapiThread : public ChildThread, base::win::ScopedHandle peer_handle_; #endif - DispatcherMessageListener dispatcher_message_listener_; - DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread); }; diff --git a/ppapi/shared_impl/api_id.h b/ppapi/shared_impl/api_id.h index c482a029a384dc..104a078a07a74e 100644 --- a/ppapi/shared_impl/api_id.h +++ b/ppapi/shared_impl/api_id.h @@ -31,7 +31,6 @@ enum ApiID { API_ID_PPB_FONT, API_ID_PPB_GRAPHICS_2D, API_ID_PPB_GRAPHICS_3D, - API_ID_PPB_HOSTRESOLVER_PRIVATE, API_ID_PPB_IMAGE_DATA, API_ID_PPB_INSTANCE, API_ID_PPB_INSTANCE_PRIVATE,