Commit ac00cdb5 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Ensure sad tab is shown for all abnormal terminations.

WebView was calling WebContents::IsCrashed() to determine if the
crashed overlay view (sad tab) should be shown on top of the web
contents, but on Windows only, IsCrashed() was returning false for
a tab that was killed due to OOM.

It's not clear whether OOM should count as a crash or not or
whether there should be a platform difference. However, this bug
can be fixed safely either way. The real logic determining whether a
sad tab is shown or not happens in SadTabHelper. It's sufficient for
WebView to just check whether the WebContents has any abnormal
termination status, and show the crashed overlay view if so.

Bug: 817124
Change-Id: I7ba5f5f40e8d4499ec509b38471bbc1a1f8b6225
Reviewed-on: https://chromium-review.googlesource.com/993992
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548086}
parent b0e60137
......@@ -347,7 +347,14 @@ void WebView::ReattachForFullscreenChange(bool enter_fullscreen) {
}
void WebView::UpdateCrashedOverlayView() {
if (web_contents() && web_contents()->IsCrashed() && crashed_overlay_view_) {
// TODO(dmazzoni): Fix WebContents::IsCrashed() so we can call that
// instead of checking termination status codes.
if (web_contents() &&
web_contents()->GetCrashedStatus() !=
base::TERMINATION_STATUS_NORMAL_TERMINATION &&
web_contents()->GetCrashedStatus() !=
base::TERMINATION_STATUS_STILL_RUNNING &&
crashed_overlay_view_) {
SetFocusBehavior(FocusBehavior::NEVER);
holder_->SetVisible(false);
crashed_overlay_view_->SetVisible(true);
......
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