Commit bac91940 authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Commit Bot

Removing callers of the WebContents::GetRenderProcessHost() method.

WebContents::GetRenderProcessHost is an API that doesn't behave as
expected with out-of-process iframes, as multiple processes can be
associated with a single WebContents.  This CL replaces callers of this
API, so that they go through an equivalent API that explicitly selects
which frame's process is needed.

This CL was started by using an ad-hoc clang-plugin that replaced
existing callsites of WebContents::GetRenderProcessHost() with a call to
something like wc->GetMainFrame()->GetProcess().  This was followed-up
by manually adding an include of render_frame_host.h and git cl format
and git cl lint and then a self-review with small tweaks (e.g. sometimes
using a wc->GetRenderViewHost()->GetProcess() is more appropriate).

This CL was uploaded by git cl split.

R=jyasskin@chromium.org

Bug: 666525
Change-Id: I583ec4076732a84814ed05e2fe06b1d07ded6dee
Reviewed-on: https://chromium-review.googlesource.com/688760Reviewed-by: default avatarJeffrey Yasskin <jyasskin@chromium.org>
Reviewed-by: default avatarConley Owens <cco3@chromium.org>
Commit-Queue: Jeffrey Yasskin <jyasskin@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506116}
parent 5ad3c22d
......@@ -76,7 +76,8 @@ IN_PROC_BROWSER_TEST_F(WebBluetoothTest, WebBluetoothAfterCrash) {
EXPECT_EQ("NotFoundError: Bluetooth adapter not available.", result);
// Crash the renderer process.
content::RenderProcessHost* process = web_contents_->GetRenderProcessHost();
content::RenderProcessHost* process =
web_contents_->GetMainFrame()->GetProcess();
content::RenderProcessHostWatcher crash_observer(
process, content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
process->Shutdown(0, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment