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

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

Issue 444813002: Remove BrowserPlugin's -internal-attach method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't crash on tear down Created 6 years, 4 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_message_filter.cc
diff --git a/content/browser/browser_plugin/browser_plugin_message_filter.cc b/content/browser/browser_plugin/browser_plugin_message_filter.cc
index e82fb7a031a62f39bee9bdb81918a1e4c3536a22..d18e0291fcf6acffc6e1b3add443ac72fb79ae65 100644
--- a/content/browser/browser_plugin/browser_plugin_message_filter.cc
+++ b/content/browser/browser_plugin/browser_plugin_message_filter.cc
@@ -70,20 +70,22 @@ static void BrowserPluginGuestMessageCallback(const IPC::Message& message,
void BrowserPluginMessageFilter::ForwardMessageToGuest(
const IPC::Message& message) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- RenderProcessHostImpl* host = static_cast<RenderProcessHostImpl*>(
- RenderProcessHost::FromID(render_process_id_));
- if (!host)
+ RenderViewHost* rvh = RenderViewHost::FromID(render_process_id_,
+ message.routing_id());
+ if (!rvh)
return;
- int instance_id = 0;
+ WebContents* embedder_web_contents = WebContents::FromRenderViewHost(rvh);
+
+ int browser_plugin_instance_id = 0;
// All allowed messages must have instance_id as their first parameter.
PickleIterator iter(message);
- bool success = iter.ReadInt(&instance_id);
+ bool success = iter.ReadInt(&browser_plugin_instance_id);
DCHECK(success);
- host->GetBrowserContext()->GetGuestManager()->
+ embedder_web_contents->GetBrowserContext()->GetGuestManager()->
MaybeGetGuestByInstanceIDOrKill(
- instance_id,
- render_process_id_,
+ embedder_web_contents,
+ browser_plugin_instance_id,
base::Bind(&BrowserPluginGuestMessageCallback,
message));
}
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | content/browser/frame_host/render_widget_host_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698