Chromium Code Reviews| 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(); |