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

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: Change the histogram name and discription 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..df7ef3a91b6bfc43a9ba2a92de06f829ef559d9b 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -256,6 +256,12 @@ TouchTargetAndDispatchResultType toTouchTargetHistogramValue(EventTarget* eventT
return static_cast<TouchTargetAndDispatchResultType>(result);
}
+enum TouchEventDispatchResultType {
+ UnhandledTouches, // Unhandled touch events.
+ HandledTouches, // Handled touch events.
+ TouchEventDispatchResultTypeMax,
+};
+
} // namespace
using namespace HTMLNames;
@@ -3893,11 +3899,19 @@ WebInputEventResult EventHandler::dispatchTouchEvents(const PlatformTouchEvent&
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));
+
+ // Count the handled touch starts and first touch moves before and after the page is fully loaded respectively.
+ if (m_frame->document()->isLoadCompleted()) {
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsAfterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEventDispatchResultTypeMax));
+ touchDispositionsAfterPageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches);
+ } else {
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsBeforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEventDispatchResultTypeMax));
+ touchDispositionsBeforePageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches);
+ }
}
eventResult = mergeEventResult(eventResult, toWebInputEventResult(domDispatchResult));
}
}
-
return eventResult;
}
« 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