| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/input/TouchEventManager.h" | 5 #include "core/input/TouchEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/events/TouchEvent.h" | 8 #include "core/events/TouchEvent.h" |
| 9 #include "core/frame/Deprecation.h" | 9 #include "core/frame/Deprecation.h" |
| 10 #include "core/frame/EventHandlerRegistry.h" | 10 #include "core/frame/EventHandlerRegistry.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 eventName, touchEventTarget->toNode()->document().domWindow(), | 186 eventName, touchEventTarget->toNode()->document().domWindow(), |
| 187 event.getModifiers(), event.cancelable(), event.causesScrollingI
fUncanceled(), touchStartOrFirstTouchMove, event.timestamp()); | 187 event.getModifiers(), event.cancelable(), event.causesScrollingI
fUncanceled(), touchStartOrFirstTouchMove, event.timestamp()); |
| 188 | 188 |
| 189 DispatchEventResult domDispatchResult = touchEventTarget->dispatchEv
ent(touchEvent); | 189 DispatchEventResult domDispatchResult = touchEventTarget->dispatchEv
ent(touchEvent); |
| 190 | 190 |
| 191 // Only report for top level documents with a single touch on | 191 // Only report for top level documents with a single touch on |
| 192 // touch-start or the first touch-move. | 192 // touch-start or the first touch-move. |
| 193 if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.ca
ncelable() && m_frame->isMainFrame()) { | 193 if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.ca
ncelable() && m_frame->isMainFrame()) { |
| 194 | 194 |
| 195 // Record the disposition and latency of touch starts and first
touch moves before and after the page is fully loaded respectively. | 195 // Record the disposition and latency of touch starts and first
touch moves before and after the page is fully loaded respectively. |
| 196 int64_t latencyInMicros = static_cast<int64_t>((currentTime() -
event.timestamp()) * 1000000.0); | 196 int64_t latencyInMicros = static_cast<int64_t>((monotonicallyInc
reasingTime() - event.timestamp()) * 1000000.0); |
| 197 if (m_frame->document()->isLoadCompleted()) { | 197 if (m_frame->document()->isLoadCompleted()) { |
| 198 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsA
fterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEvent
DispatchResultTypeMax)); | 198 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsA
fterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEvent
DispatchResultTypeMax)); |
| 199 touchDispositionsAfterPageLoadHistogram.count((domDispatchRe
sult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); | 199 touchDispositionsAfterPageLoadHistogram.count((domDispatchRe
sult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| 200 | 200 |
| 201 DEFINE_STATIC_LOCAL(CustomCountHistogram, eventLatencyAfterP
ageLoadHistogram, ("Event.Touch.TouchLatencyAfterPageLoad", 1, 100000000, 50)); | 201 DEFINE_STATIC_LOCAL(CustomCountHistogram, eventLatencyAfterP
ageLoadHistogram, ("Event.Touch.TouchLatencyAfterPageLoad", 1, 100000000, 50)); |
| 202 eventLatencyAfterPageLoadHistogram.count(latencyInMicros); | 202 eventLatencyAfterPageLoadHistogram.count(latencyInMicros); |
| 203 } else { | 203 } else { |
| 204 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsB
eforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEve
ntDispatchResultTypeMax)); | 204 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsB
eforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEve
ntDispatchResultTypeMax)); |
| 205 touchDispositionsBeforePageLoadHistogram.count((domDispatchR
esult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); | 205 touchDispositionsBeforePageLoadHistogram.count((domDispatchR
esult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); |
| 206 | 206 |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 feature = UseCounter::TouchEndDuringScrollUserGestureUtilized; | 540 feature = UseCounter::TouchEndDuringScrollUserGestureUtilized; |
| 541 break; | 541 break; |
| 542 default: | 542 default: |
| 543 NOTREACHED(); | 543 NOTREACHED(); |
| 544 return; | 544 return; |
| 545 } | 545 } |
| 546 Deprecation::countDeprecation(m_frame, feature); | 546 Deprecation::countDeprecation(m_frame, feature); |
| 547 } | 547 } |
| 548 | 548 |
| 549 } // namespace blink | 549 } // namespace blink |
| OLD | NEW |