Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/TouchEventManager.cpp |
| diff --git a/third_party/WebKit/Source/core/input/TouchEventManager.cpp b/third_party/WebKit/Source/core/input/TouchEventManager.cpp |
| index 23c662db3de37c89c572522c479f0b4547ae49c8..369707250c9c3015ac876da901f825e991881f67 100644 |
| --- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp |
| +++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp |
| @@ -16,7 +16,7 @@ |
| #include "core/page/Page.h" |
| #include "platform/Histogram.h" |
| #include "platform/PlatformTouchEvent.h" |
| - |
| +#include "wtf/CurrentTime.h" |
| namespace blink { |
| @@ -243,13 +243,20 @@ WebInputEventResult TouchEventManager::dispatchTouchEvents( |
| DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListenerHistogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResultTypeMax)); |
| rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(eventTarget, domDispatchResult)); |
| - // Count the handled touch starts and first touch moves before and after the page is fully loaded respectively. |
| + // Record the disposition and latency of touch starts and first touch moves before and after the page is fully loaded respectively. |
| + int64_t latencyInMicros = static_cast<int64_t>((currentTime() - event.timestamp()) * 1000000.0); |
| if (m_frame->document()->isLoadCompleted()) { |
| DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsAfterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEventDispatchResultTypeMax)); |
| touchDispositionsAfterPageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| + |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, eventLatencyAfterPageLoadHistogram, ("Event.Touch.TouchesAfterPageLoadLatency", 1, 100000000, 100)); |
|
Ilya Sherman
2016/05/17 01:24:55
Do you need 100 buckets, or would 50 suffice? (50
lanwei
2016/05/17 17:57:30
Change to 50.
|
| + eventLatencyAfterPageLoadHistogram.count(latencyInMicros); |
| } else { |
| DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsBeforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEventDispatchResultTypeMax)); |
| touchDispositionsBeforePageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| + |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, eventLatencyBeforePageLoadHistogram, ("Event.Touch.TouchesBeforePageLoadLatency", 1, 100000000, 100)); |
|
Ilya Sherman
2016/05/17 01:24:55
Ditto
|
| + eventLatencyBeforePageLoadHistogram.count(latencyInMicros); |
| } |
| } |
| eventResult = EventHandler::mergeEventResult(eventResult, |