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

Unified Diff: ppapi/proxy/plugin_message_filter.cc

Issue 869883003: Never lock the Pepper proxy lock on the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix size_t vs int32_t Created 5 years, 9 months 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
« no previous file with comments | « ppapi/proxy/plugin_message_filter.h ('k') | ppapi/proxy/ppapi_proxy_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_message_filter.cc
diff --git a/ppapi/proxy/plugin_message_filter.cc b/ppapi/proxy/plugin_message_filter.cc
index f2f1cbeef144475778d7119a4dcfc2b4d04d99b1..d9dadc37f581824c26470c10f7568983d8369d0f 100644
--- a/ppapi/proxy/plugin_message_filter.cc
+++ b/ppapi/proxy/plugin_message_filter.cc
@@ -54,6 +54,11 @@ bool PluginMessageFilter::Send(IPC::Message* msg) {
return false;
}
+void PluginMessageFilter::AddResourceMessageFilter(
+ const scoped_refptr<ResourceMessageFilter>& filter) {
+ resource_filters_.push_back(filter);
+}
+
// static
void PluginMessageFilter::DispatchResourceReplyForTest(
const ResourceMessageReplyParams& reply_params,
@@ -82,17 +87,15 @@ void PluginMessageFilter::OnMsgReserveInstanceId(PP_Instance instance,
void PluginMessageFilter::OnMsgResourceReply(
const ResourceMessageReplyParams& reply_params,
const IPC::Message& nested_msg) {
+ for (const auto& filter_ptr : resource_filters_) {
+ if (filter_ptr->OnResourceReplyReceived(reply_params, nested_msg))
+ return;
+ }
scoped_refptr<base::MessageLoopProxy> target =
resource_reply_thread_registrar_->GetTargetThread(reply_params,
nested_msg);
-
- if (!target.get()) {
- DispatchResourceReply(reply_params, nested_msg);
- } else {
- target->PostTask(
- FROM_HERE,
- base::Bind(&DispatchResourceReply, reply_params, nested_msg));
- }
+ target->PostTask(
+ FROM_HERE, base::Bind(&DispatchResourceReply, reply_params, nested_msg));
}
// static
« no previous file with comments | « ppapi/proxy/plugin_message_filter.h ('k') | ppapi/proxy/ppapi_proxy_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698