Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: third_party/WebKit/Source/core/input/TouchEventManager.cpp

Issue 2542693002: Use WTF::TimeTicks to represent timestamp in Platform/Core event types (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 DispatchEventResult domDispatchResult = 200 DispatchEventResult domDispatchResult =
201 touchEventTarget->dispatchEvent(touchEvent); 201 touchEventTarget->dispatchEvent(touchEvent);
202 202
203 // Only report for top level documents with a single touch on 203 // Only report for top level documents with a single touch on
204 // touch-start or the first touch-move. 204 // touch-start or the first touch-move.
205 if (event.touchStartOrFirstTouchMove() && touchInfos.size() == 1 && 205 if (event.touchStartOrFirstTouchMove() && touchInfos.size() == 1 &&
206 m_frame->isMainFrame()) { 206 m_frame->isMainFrame()) {
207 // Record the disposition and latency of touch starts and first touch 207 // Record the disposition and latency of touch starts and first touch
208 // moves before and after the page is fully loaded respectively. 208 // moves before and after the page is fully loaded respectively.
209 int64_t latencyInMicros = static_cast<int64_t>( 209 int64_t latencyInMicros =
210 (monotonicallyIncreasingTime() - event.timestamp()) * 1000000.0); 210 (TimeTicks::Now() - event.timestamp()).InMicroseconds();
211 if (event.cancelable()) { 211 if (event.cancelable()) {
212 if (m_frame->document()->isLoadCompleted()) { 212 if (m_frame->document()->isLoadCompleted()) {
213 DEFINE_STATIC_LOCAL(EnumerationHistogram, 213 DEFINE_STATIC_LOCAL(EnumerationHistogram,
214 touchDispositionsAfterPageLoadHistogram, 214 touchDispositionsAfterPageLoadHistogram,
215 ("Event.Touch.TouchDispositionsAfterPageLoad", 215 ("Event.Touch.TouchDispositionsAfterPageLoad",
216 TouchEventDispatchResultTypeMax)); 216 TouchEventDispatchResultTypeMax));
217 touchDispositionsAfterPageLoadHistogram.count( 217 touchDispositionsAfterPageLoadHistogram.count(
218 (domDispatchResult != DispatchEventResult::NotCanceled) 218 (domDispatchResult != DispatchEventResult::NotCanceled)
219 ? HandledTouches 219 ? HandledTouches
220 : UnhandledTouches); 220 : UnhandledTouches);
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 } 504 }
505 505
506 return dispatchTouchEvents(event, touchInfos, allTouchesReleased); 506 return dispatchTouchEvents(event, touchInfos, allTouchesReleased);
507 } 507 }
508 508
509 bool TouchEventManager::isAnyTouchActive() const { 509 bool TouchEventManager::isAnyTouchActive() const {
510 return m_touchPressed; 510 return m_touchPressed;
511 } 511 }
512 512
513 } // namespace blink 513 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698