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

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

Issue 2090903003: Add use counters for the passive option to addEventListener (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update histograms 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('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 eebbc970a39888170bcd91bc0d0942934f824d3d..0e63681afa13968b740bfcbab3032796d84d8acf 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -193,6 +193,12 @@ void EventTarget::setDefaultAddEventListenerOptions(const AtomicString& eventTyp
return;
}
+ if (LocalDOMWindow* executingWindow = this->executingWindow()) {
+ if (options.hasPassive()) {
+ UseCounter::count(executingWindow->document(), options.passive() ? UseCounter::AddEventListenerPassiveTrue : UseCounter::AddEventListenerPassiveFalse);
+ }
+ }
+
if (Settings* settings = windowSettings(executingWindow())) {
switch (settings->passiveListenerDefault()) {
case PassiveListenerDefault::False:
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698