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 597100315230e4647231157628744570e5205f5c..e8008c0f0c2c02a411db291927069be3de96ba2c 100644 |
| --- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp |
| +++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp |
| @@ -192,31 +192,35 @@ WebInputEventResult TouchEventManager::dispatchTouchEvents( |
| // Only report for top level documents with a single touch on |
| // touch-start or the first touch-move. |
| - if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.cancelable() && m_frame->isMainFrame()) { |
| + if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && m_frame->isMainFrame()) { |
| // 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>((monotonicallyIncreasingTime() - 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); |
| + if (event.cancelable()) { |
| + 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.TouchLatencyAfterPageLoad", 1, 100000000, 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, eventLatencyAfterPageLoadHistogram, ("Event.Touch.TouchLatencyAfterPageLoad", 1, 100000000, 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.TouchLatencyBeforePageLoad", 1, 100000000, 50)); |
| - eventLatencyBeforePageLoadHistogram.count(latencyInMicros); |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, eventLatencyBeforePageLoadHistogram, ("Event.Touch.TouchLatencyBeforePageLoad", 1, 100000000, 50)); |
| + eventLatencyBeforePageLoadHistogram.count(latencyInMicros); |
| + } |
| } |
| // Report the touch disposition, split by whether there is an active fling animation. |
| - if (event.type() == PlatformEvent::TouchStart) { |
| - if (event.dispatchedDuringFling()) { |
| - DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsDuringFlingHistogram, ("Event.Touch.TouchDispositionsDuringFling", TouchEventDispatchResultTypeMax)); |
| + if (event.dispatchedDuringFling()) { |
| + if (event.dispatchType() == PlatformEvent::ListenersForcedNonBlockingPassiveDueToFling) { |
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsDuringFlingHistogram, ("Event.Touch.TouchDispositionsDuringFling2", TouchEventDispatchResultTypeMax)); |
|
dtapuska
2016/08/10 14:47:42
if it is forced to be non blocking then it will al
|
| touchDispositionsDuringFlingHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| - } else { |
| - DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsOutsideFlingHistogram, ("Event.Touch.TouchDispositionsOutsideFling", TouchEventDispatchResultTypeMax)); |
| + } |
| + } else { |
| + if (event.cancelable()) { |
| + DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsOutsideFlingHistogram, ("Event.Touch.TouchDispositionsOutsideFling2", TouchEventDispatchResultTypeMax)); |
| touchDispositionsOutsideFlingHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| } |
| } |