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 /ppapi/proxy/plugin_dispatcher.cc | |
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 'ppapi/proxy/plugin_dispatcher.cc')
-rw-r--r-- | ppapi/proxy/plugin_dispatcher.cc | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc index 4dc3a45..6cd0ab4 100644 --- a/ppapi/proxy/plugin_dispatcher.cc +++ b/ppapi/proxy/plugin_dispatcher.cc @@ -29,7 +29,7 @@ #include "ppapi/proxy/ppb_instance_proxy.h" #include "ppapi/proxy/ppp_class_proxy.h" #include "ppapi/proxy/resource_creation_proxy.h" -#include "ppapi/proxy/resource_message_params.h" +#include "ppapi/proxy/resource_reply_thread_registrar.h" #include "ppapi/shared_impl/ppapi_globals.h" #include "ppapi/shared_impl/proxy_lock.h" #include "ppapi/shared_impl/resource.h" @@ -173,7 +173,9 @@ bool PluginDispatcher::InitPluginWithChannel( // The message filter will intercept and process certain messages directly // on the I/O thread. channel()->AddFilter( - new PluginMessageFilter(delegate->GetGloballySeenInstanceIDSet())); + new PluginMessageFilter( + delegate->GetGloballySeenInstanceIDSet(), + PluginGlobals::Get()->resource_reply_thread_registrar())); return true; } @@ -226,7 +228,6 @@ bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) { // Handle some plugin-specific control messages. bool handled = true; IPC_BEGIN_MESSAGE_MAP(PluginDispatcher, msg) - IPC_MESSAGE_HANDLER(PpapiPluginMsg_ResourceReply, OnMsgResourceReply) IPC_MESSAGE_HANDLER(PpapiMsg_SupportsInterface, OnMsgSupportsInterface) IPC_MESSAGE_HANDLER(PpapiMsg_SetPreferences, OnMsgSetPreferences) IPC_MESSAGE_UNHANDLED(handled = false); @@ -287,16 +288,6 @@ thunk::ResourceCreationAPI* PluginDispatcher::GetResourceCreationAPI() { GetInterfaceProxy(API_ID_RESOURCE_CREATION)); } -// static -void PluginDispatcher::DispatchResourceReply( - const ppapi::proxy::ResourceMessageReplyParams& reply_params, - const IPC::Message& nested_msg) { - // We need to grab the proxy lock to ensure that we don't collide with the - // plugin making pepper calls on a different thread. - ProxyAutoLock lock; - LockedDispatchResourceReply(reply_params, nested_msg); -} - void PluginDispatcher::ForceFreeAllInstances() { if (!g_instance_to_dispatcher) return; @@ -315,12 +306,6 @@ void PluginDispatcher::ForceFreeAllInstances() { } } -void PluginDispatcher::OnMsgResourceReply( - const ppapi::proxy::ResourceMessageReplyParams& reply_params, - const IPC::Message& nested_msg) { - LockedDispatchResourceReply(reply_params, nested_msg); -} - void PluginDispatcher::OnMsgSupportsInterface( const std::string& interface_name, bool* result) { @@ -349,20 +334,5 @@ void PluginDispatcher::OnMsgSetPreferences(const Preferences& prefs) { } } -// static -void PluginDispatcher::LockedDispatchResourceReply( - const ppapi::proxy::ResourceMessageReplyParams& reply_params, - const IPC::Message& nested_msg) { - Resource* resource = PpapiGlobals::Get()->GetResourceTracker()->GetResource( - reply_params.pp_resource()); - if (!resource) { - DLOG_IF(INFO, reply_params.sequence() != 0) - << "Pepper resource reply message received but the resource doesn't " - "exist (probably has been destroyed)."; - return; - } - resource->OnReplyReceived(reply_params, nested_msg); -} - } // namespace proxy } // namespace ppapi |