Chromium Code Reviews| 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 |