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

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

Issue 1879233005: Add UMA metric for tracking listeners for blocking touch before page finished loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 3870 matching lines...) Expand 10 before | Expand all | Expand 10 after
3881 const AtomicString& eventName(touchEventNameForTouchPointState(static_ca st<PlatformTouchPoint::TouchState>(state))); 3881 const AtomicString& eventName(touchEventNameForTouchPointState(static_ca st<PlatformTouchPoint::TouchState>(state)));
3882 for (const auto& eventTarget : changedTouches[state].m_targets) { 3882 for (const auto& eventTarget : changedTouches[state].m_targets) {
3883 EventTarget* touchEventTarget = eventTarget; 3883 EventTarget* touchEventTarget = eventTarget;
3884 TouchEvent* touchEvent = TouchEvent::create( 3884 TouchEvent* touchEvent = TouchEvent::create(
3885 touches, touchesByTarget.get(touchEventTarget), changedTouches[s tate].m_touches.get(), 3885 touches, touchesByTarget.get(touchEventTarget), changedTouches[s tate].m_touches.get(),
3886 eventName, touchEventTarget->toNode()->document().domWindow(), 3886 eventName, touchEventTarget->toNode()->document().domWindow(),
3887 event.getModifiers(), event.cancelable(), event.causesScrollingI fUncanceled(), event.timestamp()); 3887 event.getModifiers(), event.cancelable(), event.causesScrollingI fUncanceled(), event.timestamp());
3888 3888
3889 DispatchEventResult domDispatchResult = touchEventTarget->dispatchEv ent(touchEvent); 3889 DispatchEventResult domDispatchResult = touchEventTarget->dispatchEv ent(touchEvent);
3890 3890
3891 // Only report for top level documents with a single touch on 3891 if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.ca ncelable()) {
3892 // touch-start or the first touch-move. 3892 // Only report for top level documents with a single touch on
3893 if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.ca ncelable() && !m_frame->document()->ownerElement()) { 3893 // touch-start or the first touch-move.
3894 DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListenerHi stogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResultTyp eMax)); 3894 if (!m_frame->document()->ownerElement()) {
3895 rootDocumentListenerHistogram.count(toTouchTargetHistogramValue( eventTarget, domDispatchResult)); 3895 DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListen erHistogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResul tTypeMax));
3896 rootDocumentListenerHistogram.count(toTouchTargetHistogramVa lue(eventTarget, domDispatchResult));
3897 }
3898
3899 // Only count the canceled touch starts and first touch moves li stener before page finishes loading.
3900 if (!m_frame->document()->isLoadCompleted()) {
3901 DEFINE_STATIC_LOCAL(EnumerationHistogram, pageloadListenerHi stogram, ("Event.Touch.TouchBlockingOnPageload", 2));
dtapuska 2016/04/22 17:34:14 I'd prefer if these were called out as enums; as o
tdresser 2016/04/22 17:34:52 Let's have two histograms, once for before pageloa
tdresser 2016/04/22 17:37:06 Sorry, missed the condition above that checked tha
dtapuska 2016/04/22 17:39:10 How do we want to report this for iframes?
tdresser 2016/04/22 17:51:13 I think we should only care about the top frame's
dtapuska 2016/04/22 18:02:35 Right so the !m_frame->document()->ownerElement()
3902 pageloadListenerHistogram.count((domDispatchResult != Dispat chEventResult::NotCanceled) ? 1 : 0);
3903 }
3896 } 3904 }
3897 eventResult = mergeEventResult(eventResult, toWebInputEventResult(do mDispatchResult)); 3905 eventResult = mergeEventResult(eventResult, toWebInputEventResult(do mDispatchResult));
3898 } 3906 }
3899 } 3907 }
3900 3908
3901 return eventResult; 3909 return eventResult;
3902 } 3910 }
3903 3911
3904 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt) 3912 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt)
3905 { 3913 {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
4170 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4178 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4171 { 4179 {
4172 #if OS(MACOSX) 4180 #if OS(MACOSX)
4173 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4181 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4174 #else 4182 #else
4175 return PlatformEvent::AltKey; 4183 return PlatformEvent::AltKey;
4176 #endif 4184 #endif
4177 } 4185 }
4178 4186
4179 } // namespace blink 4187 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698