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

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

Issue 1923973002: Add UMA metric for tracking listeners for blocking touch while fling is happening (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change comments in histogram Created 4 years, 7 months 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/EventHandlerRegistry.h" 9 #include "core/frame/EventHandlerRegistry.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 rootDocumentListenerHistogram.count(toTouchTargetHistogramValue( eventTarget, domDispatchResult)); 244 rootDocumentListenerHistogram.count(toTouchTargetHistogramValue( eventTarget, domDispatchResult));
245 245
246 // Count the handled touch starts and first touch moves before a nd after the page is fully loaded respectively. 246 // Count the handled touch starts and first touch moves before a nd after the page is fully loaded respectively.
247 if (m_frame->document()->isLoadCompleted()) { 247 if (m_frame->document()->isLoadCompleted()) {
248 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsA fterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEvent DispatchResultTypeMax)); 248 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsA fterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEvent DispatchResultTypeMax));
249 touchDispositionsAfterPageLoadHistogram.count((domDispatchRe sult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); 249 touchDispositionsAfterPageLoadHistogram.count((domDispatchRe sult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches);
250 } else { 250 } else {
251 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsB eforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEve ntDispatchResultTypeMax)); 251 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsB eforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEve ntDispatchResultTypeMax));
252 touchDispositionsBeforePageLoadHistogram.count((domDispatchR esult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches); 252 touchDispositionsBeforePageLoadHistogram.count((domDispatchR esult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches);
253 } 253 }
254
255 // Report the touch disposition, split by whether there is an ac tive fling animation.
256 if (event.type() == PlatformEvent::TouchStart) {
257 if (event.dispatchedDuringFling()) {
258 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositi onsDuringFlingHistogram, ("Event.Touch.TouchDispositionsDuringFling", TouchEvent DispatchResultTypeMax));
259 touchDispositionsDuringFlingHistogram.count((domDispatch Result != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches) ;
260 } else {
261 DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositi onsOutsideFlingHistogram, ("Event.Touch.TouchDispositionsOutsideFling", TouchEve ntDispatchResultTypeMax));
262 touchDispositionsOutsideFlingHistogram.count((domDispatc hResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches );
263 }
264 }
254 } 265 }
255 eventResult = EventHandler::mergeEventResult(eventResult, 266 eventResult = EventHandler::mergeEventResult(eventResult,
256 EventHandler::toWebInputEventResult(domDispatchResult)); 267 EventHandler::toWebInputEventResult(domDispatchResult));
257 } 268 }
258 } 269 }
259 return eventResult; 270 return eventResult;
260 } 271 }
261 272
262 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts( 273 void TouchEventManager::updateTargetAndRegionMapsForTouchStarts(
263 HeapVector<TouchInfo>& touchInfos) 274 HeapVector<TouchInfo>& touchInfos)
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 } 529 }
519 530
520 DEFINE_TRACE(TouchEventManager) 531 DEFINE_TRACE(TouchEventManager)
521 { 532 {
522 visitor->trace(m_frame); 533 visitor->trace(m_frame);
523 visitor->trace(m_touchSequenceDocument); 534 visitor->trace(m_touchSequenceDocument);
524 visitor->trace(m_targetForTouchID); 535 visitor->trace(m_targetForTouchID);
525 } 536 }
526 537
527 } // namespace blink 538 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/mus/compositor_mus_connection_unittest.cc ('k') | third_party/WebKit/Source/platform/PlatformTouchEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698