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

Unified Diff: Source/core/dom/Document.cpp

Issue 703383002: Prevent firing BeforeUnloadEvents re-entrantly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | « LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 5dff7d9be6b17f60c61c6dafcbe06da45d9792d9..c9df01d4efa2414631c9617e538ca2be19576d82 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -2581,6 +2581,9 @@ bool Document::dispatchBeforeUnloadEvent(Chrome& chrome, bool& didAllowNavigatio
if (!body())
return true;
+ if (processingBeforeUnload())
+ return false;
+
RefPtrWillBeRawPtr<Document> protect(this);
RefPtrWillBeRawPtr<BeforeUnloadEvent> beforeUnloadEvent = BeforeUnloadEvent::create();
« no previous file with comments | « LayoutTests/http/tests/misc/resources/reentrant-beforeunload-helper.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698