diff options
author | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-12 12:25:33 +0000 |
---|---|---|
committer | yzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-12 12:25:33 +0000 |
commit | 511c58e956bf665d7cbd941535cfa5a634ab4e0f (patch) | |
tree | ab0658c40efa18541d229e2fada440fb81a54ef0 /content/ppapi_plugin | |
parent | 512040e5b57383c25605735ce31abf55efe007ee (diff) | |
download | chromium_src-511c58e956bf665d7cbd941535cfa5a634ab4e0f.zip chromium_src-511c58e956bf665d7cbd941535cfa5a634ab4e0f.tar.gz chromium_src-511c58e956bf665d7cbd941535cfa5a634ab4e0f.tar.bz2 |
Support using TrackedCallbacks as hints to determine the handling thread of resource reply messages.
BUG=269737
TEST=None
Review URL: https://codereview.chromium.org/46433002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.cc | 16 | ||||
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.h | 3 |
2 files changed, 8 insertions, 11 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index f0db156..5ed1873 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -36,7 +36,9 @@ #include "ppapi/c/ppp.h" #include "ppapi/proxy/interface_list.h" #include "ppapi/proxy/plugin_globals.h" +#include "ppapi/proxy/plugin_message_filter.h" #include "ppapi/proxy/ppapi_messages.h" +#include "ppapi/proxy/resource_reply_thread_registrar.h" #include "third_party/WebKit/public/web/WebKit.h" #include "ui/base/ui_base_switches.h" @@ -72,6 +74,12 @@ PpapiThread::PpapiThread(const CommandLine& command_line, bool is_broker) webkit_platform_support_.reset(new PpapiWebKitPlatformSupportImpl); blink::initialize(webkit_platform_support_.get()); + + if (!is_broker_) { + channel()->AddFilter( + new ppapi::proxy::PluginMessageFilter( + NULL, globals->resource_reply_thread_registrar())); + } } PpapiThread::~PpapiThread() { @@ -104,7 +112,6 @@ bool PpapiThread::OnControlMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(PpapiMsg_SetNetworkState, OnSetNetworkState) IPC_MESSAGE_HANDLER(PpapiMsg_Crash, OnCrash) IPC_MESSAGE_HANDLER(PpapiMsg_Hang, OnHang) - IPC_MESSAGE_HANDLER(PpapiPluginMsg_ResourceReply, OnResourceReply) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -355,13 +362,6 @@ void PpapiThread::OnCreateChannel(base::ProcessId renderer_pid, Send(new PpapiHostMsg_ChannelCreated(channel_handle)); } -void PpapiThread::OnResourceReply( - const ppapi::proxy::ResourceMessageReplyParams& reply_params, - const IPC::Message& nested_msg) { - ppapi::proxy::PluginDispatcher::DispatchResourceReply(reply_params, - nested_msg); -} - void PpapiThread::OnSetNetworkState(bool online) { // Note the browser-process side shouldn't send us these messages in the // first unless the plugin has dev permissions, so we don't need to check diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h index 8a06c4d..17deb5e 100644 --- a/content/ppapi_plugin/ppapi_thread.h +++ b/content/ppapi_plugin/ppapi_thread.h @@ -97,9 +97,6 @@ class PpapiThread : public ChildThread, void OnCreateChannel(base::ProcessId renderer_pid, int renderer_child_id, bool incognito); - void OnResourceReply( - const ppapi::proxy::ResourceMessageReplyParams& reply_params, - const IPC::Message& nested_msg); void OnSetNetworkState(bool online); void OnCrash(); void OnHang(); |