Commit 020d2269 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=pasko@chromium.org

Bug: 666525
Change-Id: I25740f166c501b336a5782553a5be68fd3840f62
Reviewed-on: https://chromium-review.googlesource.com/689015Reviewed-by: default avatarDavid Benjamin <davidben@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505146}
parent 87ac2e3d
......@@ -1055,7 +1055,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPage) {
ChannelDestructionWatcher channel_close_watcher;
channel_close_watcher.WatchChannel(
GetActiveWebContents()->GetRenderProcessHost());
GetActiveWebContents()->GetMainFrame()->GetProcess());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
fcp_waiter->Wait();
......@@ -1173,7 +1173,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPageRemovesPending) {
ChannelDestructionWatcher channel_close_watcher;
channel_close_watcher.WatchChannel(
GetActiveWebContents()->GetRenderProcessHost());
GetActiveWebContents()->GetMainFrame()->GetProcess());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
......@@ -1290,7 +1290,7 @@ IN_PROC_BROWSER_TEST_F(
ChannelDestructionWatcher channel_close_watcher;
channel_close_watcher.WatchChannel(
GetActiveWebContents()->GetRenderProcessHost());
GetActiveWebContents()->GetMainFrame()->GetProcess());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
......@@ -2046,8 +2046,11 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
1);
ChannelDestructionWatcher channel_close_watcher;
channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
GetActiveWebContents()->GetRenderProcessHost());
channel_close_watcher.WatchChannel(browser()
->tab_strip_model()
->GetActiveWebContents()
->GetMainFrame()
->GetProcess());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
......@@ -2061,8 +2064,11 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
FINAL_STATUS_USED, 2);
ChannelDestructionWatcher channel_close_watcher;
channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
GetActiveWebContents()->GetRenderProcessHost());
channel_close_watcher.WatchChannel(browser()
->tab_strip_model()
->GetActiveWebContents()
->GetMainFrame()
->GetProcess());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
......@@ -2758,8 +2764,11 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, WebNavigation) {
PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
ChannelDestructionWatcher channel_close_watcher;
channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
GetActiveWebContents()->GetRenderProcessHost());
channel_close_watcher.WatchChannel(browser()
->tab_strip_model()
->GetActiveWebContents()
->GetMainFrame()
->GetProcess());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
......@@ -2779,8 +2788,11 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, TabsApi) {
PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
ChannelDestructionWatcher channel_close_watcher;
channel_close_watcher.WatchChannel(browser()->tab_strip_model()->
GetActiveWebContents()->GetRenderProcessHost());
channel_close_watcher.WatchChannel(browser()
->tab_strip_model()
->GetActiveWebContents()
->GetMainFrame()
->GetProcess());
NavigateToDestURL();
channel_close_watcher.WaitForChannelClose();
......
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