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

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

Issue 1934413003: Usecounter added for counting usage of addEventListener for PointerEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/events/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index 230c6756ff1dd0844ccd0969d4815389b1012a73..df4d1a1798428cced1da7ca7502ab37cb9f622b5 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -125,6 +125,9 @@ inline LocalDOMWindow* EventTarget::executingWindow()
bool EventTarget::addEventListener(const AtomicString& eventType, EventListener* listener, bool useCapture)
{
+ if (LocalDOMWindow* executingWindow = this->executingWindow()) {
+ UseCounter::count(executingWindow->document(), UseCounter::PointerEventAddListenerCount);
+ }
EventListenerOptions options;
setDefaultEventListenerOptionsLegacy(options, useCapture);
return addEventListenerInternal(eventType, listener, options);
@@ -143,6 +146,9 @@ bool EventTarget::addEventListener(const AtomicString& eventType, EventListener*
bool EventTarget::addEventListener(const AtomicString& eventType, EventListener* listener, EventListenerOptions& options)
{
+ if (LocalDOMWindow* executingWindow = this->executingWindow()) {
+ UseCounter::count(executingWindow->document(), UseCounter::PointerEventAddListenerCount);
+ }
setDefaultEventListenerOptions(options);
return addEventListenerInternal(eventType, listener, options);
mustaq 2016/05/03 14:40:22 - Check if it is a PointerEvent type. Otherwise, w
tdresser 2016/05/03 16:13:46 Whoooops. Good catch...
}

Powered by Google App Engine
This is Rietveld 408576698