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

Unified Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 921473006: GuestView: Fix message routing across embedder navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comments CQ'ing 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: 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..d6c06fd1d65f9ae762e86422c9dc4429ac211b82 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,16 @@ void BrowserPluginEmbedder::OnUpdateDragCursor(bool* handled) {
}
void BrowserPluginEmbedder::OnAttach(
+ RenderFrameHost* render_frame_host,
int browser_plugin_instance_id,
const BrowserPluginHostMsg_Attach_Params& params) {
+ // TODO(fsamuel): Change message routing to use the process ID of the
+ // |render_frame_host| once BrowserPlugin IPCs get routed using the RFH
+ // routing ID. See http://crbug.com/436339.
WebContents* guest_web_contents =
GetBrowserPluginGuestManager()->GetGuestByInstanceID(
- GetWebContents(), browser_plugin_instance_id);
+ GetWebContents()->GetRenderProcessHost()->GetID(),
+ browser_plugin_instance_id);
if (!guest_web_contents)
return;
BrowserPluginGuest* guest = static_cast<WebContentsImpl*>(guest_web_contents)

Powered by Google App Engine
This is Rietveld 408576698