Chromium Code Reviews| Index: content/browser/browser_plugin/browser_plugin_embedder.cc |
| diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc |
| index 5313268a62405ca70663c29dd504a43baa501847..132bbd27f6a47032fb47a713c8ca921573735984 100644 |
| --- a/content/browser/browser_plugin/browser_plugin_embedder.cc |
| +++ b/content/browser/browser_plugin/browser_plugin_embedder.cc |
| @@ -98,8 +98,15 @@ void BrowserPluginEmbedder::DidSendScreenRects() { |
| } |
| bool BrowserPluginEmbedder::OnMessageReceived(const IPC::Message& message) { |
| + return OnMessageReceived(message, nullptr); |
| +} |
| + |
| +bool BrowserPluginEmbedder::OnMessageReceived( |
| + const IPC::Message& message, |
| + RenderFrameHost* render_frame_host) { |
| bool handled = true; |
| - IPC_BEGIN_MESSAGE_MAP(BrowserPluginEmbedder, message) |
| + IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(BrowserPluginEmbedder, message, |
| + render_frame_host) |
| IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_Attach, OnAttach) |
| IPC_MESSAGE_HANDLER_GENERIC(DragHostMsg_UpdateDragCursor, |
| OnUpdateDragCursor(&handled)); |
| @@ -135,11 +142,17 @@ void BrowserPluginEmbedder::OnUpdateDragCursor(bool* handled) { |
| } |
| void BrowserPluginEmbedder::OnAttach( |
| + RenderFrameHost* render_frame_host, |
| int browser_plugin_instance_id, |
| const BrowserPluginHostMsg_Attach_Params& params) { |
| + int owner_process_id = render_frame_host ? |
|
Charlie Reis
2015/02/13 21:21:56
I don't think we should support the case that this
Fady Samuel
2015/02/13 22:31:25
Using the GetWebContents()->GetRenderProcessHost()
|
| + render_frame_host->GetProcess()->GetID() : |
| + GetWebContents()->GetRenderProcessHost()->GetID(); |
| + |
| WebContents* guest_web_contents = |
| GetBrowserPluginGuestManager()->GetGuestByInstanceID( |
| - GetWebContents(), browser_plugin_instance_id); |
| + owner_process_id, |
| + browser_plugin_instance_id); |
| if (!guest_web_contents) |
| return; |
| BrowserPluginGuest* guest = static_cast<WebContentsImpl*>(guest_web_contents) |