Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2724203004: Test run for https://codereview.chromium.org/2725993002/ with the timer intentionally broken. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8800f75c0deb66fe0dfa923a9bd057515268756a..6749aafe832138b29352a637eb1107f508b56817 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2419,6 +2419,15 @@ bool WebContentsImpl::IsJavaScriptDialogShowing() const {
return is_showing_javascript_dialog_;
}
+bool WebContentsImpl::ShouldIgnoreUnresponsiveRenderer() {
+ // Ignore unresponsive renderers if the debugger is attached to them since the
+ // unresponsiveness might be a result of the renderer sitting on a breakpoint.
+ //
+ // TODO(pfeldman): Fix this to only return true if the renderer is *actually*
+ // sitting on a breakpoint. https://crbug.com/684202
+ return DevToolsAgentHost::IsDebuggerAttached(this);
+}
+
AccessibilityMode WebContentsImpl::GetAccessibilityMode() const {
return accessibility_mode_;
}
@@ -4841,13 +4850,7 @@ void WebContentsImpl::RendererUnresponsive(
if (render_widget_host != GetRenderViewHost()->GetWidget())
return;
- RenderFrameHostImpl* rfhi =
- static_cast<RenderFrameHostImpl*>(GetRenderViewHost()->GetMainFrame());
-
- // Ignore renderer unresponsive event if debugger is attached to the tab
- // since the event may be a result of the renderer sitting on a breakpoint.
- // See http://crbug.com/65458
- if (DevToolsAgentHost::IsDebuggerAttached(this))
+ if (ShouldIgnoreUnresponsiveRenderer())
return;
// Record histograms about the type of renderer hang.
@@ -4855,23 +4858,8 @@ void WebContentsImpl::RendererUnresponsive(
"ChildProcess.HangRendererType", type,
RendererUnresponsiveType::RENDERER_UNRESPONSIVE_MAX);
- // We might have been waiting for both beforeunload and unload ACK.
- // Check if tab is to be unloaded first.
- if (rfhi->IsWaitingForUnloadACK()) {
- // Hang occurred while firing the unload handler.
- // Pretend the handler fired so tab closing continues as if it had.
- GetRenderViewHost()->set_sudden_termination_allowed(true);
-
- if (!GetRenderManager()->ShouldCloseTabOnUnresponsiveRenderer())
- return;
-
- // If the tab hangs in the unload handler there's really nothing we can do
- // to recover. Pretend the unload listeners have all fired and close
- // the tab.
- Close();
- return;
- }
-
+ RenderFrameHostImpl* rfhi =
+ static_cast<RenderFrameHostImpl*>(GetRenderViewHost()->GetMainFrame());
if (rfhi->is_waiting_for_beforeunload_ack()) {
// If the hang is in the beforeunload handler, pretend the beforeunload
// listeners have all fired and allow the delegate to continue closing;
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698