summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/plugin_resource.cc
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-12 12:25:33 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-12 12:25:33 +0000
commit511c58e956bf665d7cbd941535cfa5a634ab4e0f (patch)
treeab0658c40efa18541d229e2fada440fb81a54ef0 /ppapi/proxy/plugin_resource.cc
parent512040e5b57383c25605735ce31abf55efe007ee (diff)
downloadchromium_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_resource.cc')
-rw-r--r--ppapi/proxy/plugin_resource.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc
index 3f4b612..23094fe 100644
--- a/ppapi/proxy/plugin_resource.cc
+++ b/ppapi/proxy/plugin_resource.cc
@@ -6,7 +6,9 @@
#include <limits>
+#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/ppapi_globals.h"
namespace ppapi {
namespace proxy {
@@ -16,7 +18,10 @@ PluginResource::PluginResource(Connection connection, PP_Instance instance)
connection_(connection),
next_sequence_number_(1),
sent_create_to_browser_(false),
- sent_create_to_renderer_(false) {
+ sent_create_to_renderer_(false),
+ resource_reply_thread_registrar_(
+ PpapiGlobals::Get()->IsPluginGlobals() ?
+ PluginGlobals::Get()->resource_reply_thread_registrar() : NULL) {
}
PluginResource::~PluginResource() {
@@ -28,6 +33,9 @@ PluginResource::~PluginResource() {
connection_.renderer_sender->Send(
new PpapiHostMsg_ResourceDestroyed(pp_resource()));
}
+
+ if (resource_reply_thread_registrar_)
+ resource_reply_thread_registrar_->Unregister(pp_resource());
}
void PluginResource::OnReplyReceived(