Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/EventHandler.cpp |
| diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| index 442b6da650562e5c4ac8773c60e462ed47e5999a..e0884991d190c88b2038e5eed5f37faea8f6d3e8 100644 |
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| @@ -256,6 +256,12 @@ TouchTargetAndDispatchResultType toTouchTargetHistogramValue(EventTarget* eventT |
| return static_cast<TouchTargetAndDispatchResultType>(result); |
| } |
| +enum TouchEventDispatchResultType { |
| + NotHandledTouches, // Not handled touch events. |
| + HandledTouches, // Handled touch events. |
| + TouchEventDispatchResultTypeMax, |
| +}; |
| + |
| } // namespace |
| using namespace HTMLNames; |
| @@ -3893,11 +3899,19 @@ WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent& |
| if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.cancelable() && !m_frame->document()->ownerElement()) { |
| DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListenerHistogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResultTypeMax)); |
| rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(eventTarget, domDispatchResult)); |
| + |
| + // Count the cancelled touch starts and first touch moves before and after page finishes loading respectively. |
| + if (m_frame->document()->isLoadCompleted()) { |
|
dtapuska
2016/04/22 22:48:12
Why can't this be a single histogram? Also cancele
lanwei
2016/04/22 23:55:23
I did a search of 'canceled' and 'cancelled', they
tdresser
2016/04/25 15:45:19
It's somewhat easier to view a graph of the propor
dtapuska
2016/04/25 19:49:09
Two buckets seems fine to me. Inside blink source
lanwei
2016/04/25 20:29:34
Done.
|
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, touchesCancelledAfterPageLoadHistogram, ("Event.Touch.TouchesCancelledAfterPageLoad", TouchEventDispatchResultTypeMax)); |
| + touchesCancelledAfterPageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : NotHandledTouches); |
| + } else { |
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, touchesCancelledBeforePageLoadHistogram, ("Event.Touch.TouchesCancelledBeforePageLoad", TouchEventDispatchResultTypeMax)); |
| + touchesCancelledBeforePageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : NotHandledTouches); |
| + } |
| } |
| eventResult = mergeEventResult(eventResult, toWebInputEventResult(domDispatchResult)); |
| } |
| } |
| - |
| return eventResult; |
| } |