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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2384813002: Don't wait to close tabs waiting for JavaScript dialogs. (Closed)
Patch Set: remove code no longer needed Created 4 years, 2 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
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 050a8554ea7dec1fd000696e8e17908860030280..95852d6da5c6354d74e723cc5ef32b5a822d4fb5 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -585,10 +585,15 @@ void RenderViewHostImpl::ClosePage() {
TimeDelta::FromMilliseconds(kUnloadTimeoutMS),
RenderWidgetHostDelegate::RENDERER_UNRESPONSIVE_CLOSE_PAGE);
- if (IsRenderViewLive()) {
+ bool is_javascript_dialog_showing = delegate_->IsJavaScriptDialogShowing();
+
+ // If there is a JavaScript dialog up, don't bother sending the renderer the
+ // close event because it is known unresponsive, waiting for the reply from
+ // the dialog.
+ if (IsRenderViewLive() && !is_javascript_dialog_showing) {
// Since we are sending an IPC message to the renderer, increase the event
// count to prevent the hang monitor timeout from being stopped by input
- // event acknowledgements.
+ // event acknowledgments.
GetWidget()->increment_in_flight_event_count();
// TODO(creis): Should this be moved to Shutdown? It may not be called for
@@ -600,7 +605,7 @@ void RenderViewHostImpl::ClosePage() {
Send(new ViewMsg_ClosePage(GetRoutingID()));
} else {
- // This RenderViewHost doesn't have a live renderer, so just skip the unload
+ // This RenderViewHost doesn't have a live renderer, so just skip the close
// event and close the page.
ClosePageIgnoringUnloadEvents();
}
« no previous file with comments | « content/browser/renderer_host/render_view_host_delegate.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698