Commit 455a5779 authored by Dominik Laskowski's avatar Dominik Laskowski Committed by Commit Bot

ash: Expect null window in OutputProtectionDelegate

OutputProtectionImpl may create (via OutputProtectionProxy)
an OutputProtectionDelegate with a null aura::Window* if the
RenderFrameHost is no longer alive while responding to a Mojo
request. Run failure callbacks in that case.

Bug: 987051
Test: None (sporadic crash with no repro steps)
Change-Id: I0b854aacdcdb553e349416cff76662d273d17e78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1737367
Commit-Queue: Dominik Laskowski <domlaskowski@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690073}
parent f18cb859
...@@ -33,7 +33,10 @@ OutputProtectionDelegate::OutputProtectionDelegate(aura::Window* window) ...@@ -33,7 +33,10 @@ OutputProtectionDelegate::OutputProtectionDelegate(aura::Window* window)
: window_(window), : window_(window),
display_id_( display_id_(
display::Screen::GetScreen()->GetDisplayNearestWindow(window).id()) { display::Screen::GetScreen()->GetDisplayNearestWindow(window).id()) {
DCHECK(window_); // TODO(domlaskowski): OutputProtectionImpl passes null if the RenderFrameHost
// no longer exists. Investigate removing this check in crbug.com/997270.
if (!window_)
return;
window_->AddObserver(this); window_->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this); display::Screen::GetScreen()->AddObserver(this);
......
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