Pepper: Hook up the in-process router for browser.
This is mostly stolen from raymes' change at:
https://codereview.chromium.org/15774020/
but cleaned up to apply to master. It also adds in-process variants of the ResourceCall and ResourceReply messages, which are needed because the reply message from the browser to the renderer must be properly routed.
This change has been tested (along with a series of other changes) and was shown to work for in-process plugins in the "new" resource proxy.
TBR=jochen
BUG=225441
Review URL: https://chromiumcodereview.appspot.com/19238007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214828 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/proxy/plugin_resource.cc b/ppapi/proxy/plugin_resource.cc
index 823e056..c450f3c 100644
--- a/ppapi/proxy/plugin_resource.cc
+++ b/ppapi/proxy/plugin_resource.cc
@@ -113,8 +113,18 @@
Destination dest,
const ResourceMessageCallParams& call_params,
const IPC::Message& nested_msg) {
- return GetSender(dest)->Send(
- new PpapiHostMsg_ResourceCall(call_params, nested_msg));
+ // For in-process plugins, we need to send the routing ID with the request.
+ // The browser then uses that routing ID when sending the reply so it will be
+ // routed back to the correct RenderViewImpl.
+ if (dest == BROWSER && connection_.in_process) {
+ return GetSender(dest)->Send(new PpapiHostMsg_InProcessResourceCall(
+ connection_.browser_sender_routing_id,
+ call_params,
+ nested_msg));
+ } else {
+ return GetSender(dest)->Send(
+ new PpapiHostMsg_ResourceCall(call_params, nested_msg));
+ }
}
int32_t PluginResource::GenericSyncCall(