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

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

Issue 2160353002: Added UseCounters for touchstart, mousedown, pointerdown invocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed static_cast. Created 4 years, 5 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 c9316bd79dfeb0e6a96a8137725369cb1e8aac53..e10208bb5241dfbedef1d16d927124fcb0a2b136 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -39,6 +39,7 @@
#include "core/editing/Editor.h"
#include "core/events/Event.h"
#include "core/events/EventUtil.h"
+#include "core/events/PointerEvent.h"
#include "core/frame/FrameHost.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/Settings.h"
@@ -538,6 +539,8 @@ bool EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
// dispatch. Conveniently, all new event listeners will be added after or at
// index |size|, so iterating up to (but not including) |size| naturally excludes
// new event listeners.
+ //
+ // TODO(mustaq): This code needs to be refactored, crbug.com/629601
if (event->type() == EventTypeNames::beforeunload) {
if (LocalDOMWindow* executingWindow = this->executingWindow()) {
@@ -557,6 +560,18 @@ bool EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList
} else if (event->type() == EventTypeNames::textInput) {
if (LocalDOMWindow* executingWindow = this->executingWindow())
UseCounter::count(executingWindow->document(), UseCounter::TextInputFired);
+ } else if (event->type() == EventTypeNames::touchstart) {
+ if (LocalDOMWindow* executingWindow = this->executingWindow())
+ UseCounter::count(executingWindow->document(), UseCounter::TouchStartFired);
+ } else if (event->type() == EventTypeNames::mousedown) {
+ if (LocalDOMWindow* executingWindow = this->executingWindow())
+ UseCounter::count(executingWindow->document(), UseCounter::MouseDownFired);
+ } else if (event->type() == EventTypeNames::pointerdown) {
+ if (LocalDOMWindow* executingWindow = this->executingWindow()) {
+ if (toPointerEvent(event)->pointerType() == "touch")
dtapuska 2016/07/19 20:01:54 That is now just going to crash the process. I don
mustaq 2016/07/19 20:36:07 Yikes, done.
+ UseCounter::count(executingWindow->document(), UseCounter::PointerDownFiredForTouch);
+ UseCounter::count(executingWindow->document(), UseCounter::PointerDownFired);
+ }
}
ExecutionContext* context = getExecutionContext();
« 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