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

Unified Diff: chrome/browser/ui/fast_unload_controller.cc

Issue 2783723002: Keep track in the browser of which frames have onunload and onbeforeunload handlers. (Closed)
Patch Set: fix tests Created 3 years, 9 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: chrome/browser/ui/fast_unload_controller.cc
diff --git a/chrome/browser/ui/fast_unload_controller.cc b/chrome/browser/ui/fast_unload_controller.cc
index add48b149446e25ca2899372a7c297cc82a0e08f..ca9ab81e41e2b4bd897bc67508e2a5254fae5234 100644
--- a/chrome/browser/ui/fast_unload_controller.cc
+++ b/chrome/browser/ui/fast_unload_controller.cc
@@ -407,8 +407,13 @@ void FastUnloadController::ProcessPendingTabs(bool skip_beforeunload) {
// we would like devtools to call its own beforeunload handlers first,
// and then call beforeunload handlers for |contents|.
// See DevToolsWindow::InterceptPageBeforeUnload for details.
- if (!DevToolsWindow::InterceptPageBeforeUnload(contents))
- contents->DispatchBeforeUnload();
+ if (!DevToolsWindow::InterceptPageBeforeUnload(contents)) {
+ if (contents->NeedToFireBeforeUnload()) {
+ contents->DispatchBeforeUnload();
+ } else {
+ ProcessPendingTabs(skip_beforeunload);
+ }
+ }
} else {
ProcessPendingTabs(skip_beforeunload);
}

Powered by Google App Engine
This is Rietveld 408576698