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

Avoid crashing if |webview()->MainFrame()| is null.

This CL makes sure that RenderViewImpl::GetURLForGraphicsContext3D
doesn't crash if |webview()->MainFrame()| is null.  This restores
the behavior of the code from r187650 which used to do the null check
(the check was dropped later in
https://codereview.chromium.org/444503002/patch/80001/90022).

Bug: 793999
Change-Id: I2027b69ff533fcdbc3bd7fedefc21059f032d023
Reviewed-on: https://chromium-review.googlesource.com/822911Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523570}
parent e346670f
......@@ -2175,8 +2175,9 @@ void RenderViewImpl::OnUpdateScreenInfo(const ScreenInfo& screen_info) {
GURL RenderViewImpl::GetURLForGraphicsContext3D() {
DCHECK(webview());
if (webview()->MainFrame()->IsWebLocalFrame())
return GURL(webview()->MainFrame()->ToWebLocalFrame()->GetDocument().Url());
WebFrame* main_frame = webview()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame())
return GURL(main_frame->ToWebLocalFrame()->GetDocument().Url());
else
return GURL("chrome://gpu/RenderViewImpl::CreateGraphicsContext3D");
}
......
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