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

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: some pre-review cleanup Created 5 years, 10 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
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..eaf526b95e5ec22d2cd87bc3b16a798387d8eb0e 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);
raymes 2015/03/03 03:07:44 Why can we remove this check?
dmichael (off chromium) 2015/03/03 18:27:56 This was a special case in Yuzhu's version to allo
- } else {
- target->PostTask(
- FROM_HERE,
- base::Bind(&DispatchResourceReply, reply_params, nested_msg));
- }
+ target->PostTask(
+ FROM_HERE, base::Bind(&DispatchResourceReply, reply_params, nested_msg));
}
// static

Powered by Google App Engine
This is Rietveld 408576698