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

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

Issue 2783723002: Keep track in the browser of which frames have onunload and onbeforeunload handlers. (Closed)
Patch Set: fix content_browsertests with plznavigate and also remove now unnecessary unloadcontroller change 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: 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 921ece3ec8a7e47f39bdfae3480d418ef9b0184f..1f5657a8edd3fb29d58bf79f689ff067fb13a8de 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1422,7 +1422,9 @@ void WebContentsImpl::WasUnOccluded() {
bool WebContentsImpl::NeedToFireBeforeUnload() {
// TODO(creis): Should we fire even for interstitial pages?
return WillNotifyDisconnection() && !ShowingInterstitialPage() &&
- !GetRenderViewHost()->SuddenTerminationAllowed();
+ !GetRenderViewHost()->SuddenTerminationAllowed() &&
+ (GetMainFrame()->ShouldDispatchBeforeUnload() ||
+ GetMainFrame()->ShouldDispatchUnload());
nasko 2017/03/29 23:31:26 This seems very very broken. Let's put a TODO to c
jam 2017/03/30 14:53:23 Done.
}
void WebContentsImpl::DispatchBeforeUnload() {

Powered by Google App Engine
This is Rietveld 408576698