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

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 cancelled to canceled 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') | tools/metrics/histograms/histograms.xml » ('J')
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..f050d3854a1568ece978908c14b9691a0b7a45a4 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 {
+ NotHandledTouches, // Not handled touch events.
Ilya Sherman 2016/04/26 20:27:11 "Not handled events" -- does that mean "Unhandled
lanwei 2016/04/27 04:43:30 Done.
+ 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 canceled touch starts and first touch moves before and after page finishes loading respectively.
+ if (m_frame->document()->isLoadCompleted()) {
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, touchesCanceledAfterPageLoadHistogram, ("Event.Touch.TouchesCanceledAfterPageLoad", TouchEventDispatchResultTypeMax));
+ touchesCanceledAfterPageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : NotHandledTouches);
+ } else {
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, touchesCanceledBeforePageLoadHistogram, ("Event.Touch.TouchesCanceledBeforePageLoad", TouchEventDispatchResultTypeMax));
+ touchesCanceledBeforePageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : NotHandledTouches);
+ }
}
eventResult = mergeEventResult(eventResult, toWebInputEventResult(domDispatchResult));
}
}
-
return eventResult;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698