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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2229543002: Fix UseCounter for SubframeBeforeUnloadFired. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now with test Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/events/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index 90bcd0ac657c8161af92f62be2d2ff3a033f9a16..b1aea0a395f91288cb80b5bbb6060bf1daf922a9 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -566,8 +566,7 @@ bool EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
if (checkTypeThenUseCount(event, EventTypeNames::beforeunload, UseCounter::DocumentBeforeUnloadFired)) {
if (LocalDOMWindow* executingWindow = this->executingWindow()) {
- // TODO(mustaq): Is the |if| condition correct? crbug.com/635029
- if (executingWindow->top())
+ if (executingWindow != executingWindow->top())
UseCounter::count(executingWindow->document(), UseCounter::SubFrameBeforeUnloadFired);
}
} else if (checkTypeThenUseCount(event, EventTypeNames::unload, UseCounter::DocumentUnloadFired)) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698