Commit c6083866 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=xiyuan@chromium.org

Bug: 666525
Change-Id: I10358379bca0403dc8a3d27fbfd02a632cce65d3
Reviewed-on: https://chromium-review.googlesource.com/689104Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505049}
parent e0ce83e8
......@@ -19,6 +19,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
......@@ -154,7 +155,7 @@ void RendererFreezer::OnScreenLockStateChanged(chromeos::ScreenLocker* locker,
content::WebContents* web_contents = locker->delegate()->GetWebContents();
if (web_contents) {
delegate_->SetShouldFreezeRenderer(
web_contents->GetRenderProcessHost()->GetHandle(), false);
web_contents->GetMainFrame()->GetProcess()->GetHandle(), 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