Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: ppapi/proxy/plugin_resource.cc

Issue 46433002: Support using TrackedCallbacks as hints to determine the handling thread of resource reply messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/plugin_resource.cc
diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc
index 3f4b61258b3aa6c54ce74dbb5f5a5392eb244328..23094fe84445432a7b759bdfdd24afd826284d09 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(

Powered by Google App Engine
This is Rietveld 408576698