Skip to content

Commit

Permalink
Pepper: Remove DispatcherMessageListener
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yzshen@chromium.org committed Dec 11, 2013
1 parent ea028cb commit 0eb0e87
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
33 changes: 1 addition & 32 deletions content/ppapi_plugin/ppapi_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -60,49 +59,19 @@ 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<uint32, ppapi::proxy::PluginDispatcher*>::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<PP_Module>::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(
command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs));

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() {
Expand Down
19 changes: 0 additions & 19 deletions content/ppapi_plugin/ppapi_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -173,8 +156,6 @@ class PpapiThread : public ChildThread,
base::win::ScopedHandle peer_handle_;
#endif

DispatcherMessageListener dispatcher_message_listener_;

DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread);
};

Expand Down
1 change: 0 additions & 1 deletion ppapi/shared_impl/api_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0eb0e87

Please sign in to comment.