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

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

Issue 26828003: Count beforeload separately for isolated worlds (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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 | Source/core/page/UseCounter.h » ('j') | 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 103175f8472fbe80cba9613572614233ef079e78..9c1e12d0c8ee7e534bb9790fc672873e7e18b46c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -3670,7 +3670,11 @@ void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
} else if (eventType == EventTypeNames::webkitTransitionEnd || eventType == EventTypeNames::transitionend) {
addListenerType(TRANSITIONEND_LISTENER);
} else if (eventType == EventTypeNames::beforeload) {
- UseCounter::count(*this, UseCounter::BeforeLoadEvent);
+ if (m_frame && m_frame->script()->shouldBypassMainWorldContentSecurityPolicy()) {
+ UseCounter::count(*this, UseCounter::BeforeLoadEventInIsolatedWorld);
+ } else {
+ UseCounter::count(*this, UseCounter::BeforeLoadEvent);
+ }
addListenerType(BEFORELOAD_LISTENER);
} else if (eventType == EventTypeNames::scroll) {
addListenerType(SCROLL_LISTENER);
« no previous file with comments | « no previous file | Source/core/page/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698