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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2103733004: Set navigationStart correctly for all load types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 73b5374e1fb259a7c7e283ebc37fa32fa832e0c7..dbd70133ba9236ec3aef57a965168f8ee938f144 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1351,6 +1351,7 @@ bool FrameLoader::shouldClose(bool isReload)
}
bool shouldClose = false;
+ bool eventListenerCalled = false;
{
NavigationDisablerForBeforeUnload navigationDisabler;
size_t i;
@@ -1359,7 +1360,7 @@ bool FrameLoader::shouldClose(bool isReload)
for (i = 0; i < targetFrames.size(); i++) {
if (!targetFrames[i]->tree().isDescendantOf(m_frame))
continue;
- if (!targetFrames[i]->document()->dispatchBeforeUnloadEvent(page->chromeClient(), isReload, didAllowNavigation))
+ if (!targetFrames[i]->document()->dispatchBeforeUnloadEvent(page->chromeClient(), isReload, didAllowNavigation, eventListenerCalled))
break;
}
@@ -1367,6 +1368,13 @@ bool FrameLoader::shouldClose(bool isReload)
shouldClose = true;
}
+ if (shouldClose) {
+ for (size_t i = 0; i < targetFrames.size(); ++i) {
+ if (auto* client = targetFrames[i]->loader().client())
+ client->dispatchDidHandleOnBeforeUnloadEvent(eventListenerCalled);
+ }
+ }
+
return shouldClose;
}

Powered by Google App Engine
This is Rietveld 408576698