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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 442b6da650562e5c4ac8773c60e462ed47e5999a..233379e2d45764b53adb92d25783aba6002aa1a3 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -3888,11 +3888,19 @@ WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent&
DispatchEventResult domDispatchResult = touchEventTarget->dispatchEvent(touchEvent);
- // 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->document()->ownerElement()) {
- DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListenerHistogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResultTypeMax));
- rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(eventTarget, domDispatchResult));
+ if (touchStartOrFirstTouchMove && touchInfos.size() == 1 && event.cancelable()) {
+ // Only report for top level documents with a single touch on
+ // touch-start or the first touch-move.
+ if (!m_frame->document()->ownerElement()) {
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListenerHistogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResultTypeMax));
+ rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(eventTarget, domDispatchResult));
+ }
+
+ // Only count the canceled touch starts and first touch moves listener before page finishes loading.
+ if (!m_frame->document()->isLoadCompleted()) {
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, pageloadListenerHistogram, ("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()
+ pageloadListenerHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? 1 : 0);
+ }
}
eventResult = mergeEventResult(eventResult, toWebInputEventResult(domDispatchResult));
}
« 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