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

Unified Diff: content/renderer/input/input_event_filter.cc

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: Sync the fling states 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/input/input_event_filter.cc
diff --git a/content/renderer/input/input_event_filter.cc b/content/renderer/input/input_event_filter.cc
index e62ee2cf941c784c96db901db93940ae26ccb648..e83071291434e3c2ef4286020d9da6e92ca69741 100644
--- a/content/renderer/input/input_event_filter.cc
+++ b/content/renderer/input/input_event_filter.cc
@@ -50,7 +50,9 @@ InputEventFilter::InputEventFilter(
main_listener_(main_listener),
sender_(NULL),
target_task_runner_(target_task_runner),
- current_overscroll_params_(NULL) {
+ current_overscroll_params_(NULL),
+ is_flinging_on_main_(false),
+ is_flinging_on_impl_(false) {
DCHECK(target_task_runner_.get());
}
@@ -83,9 +85,18 @@ void InputEventFilter::DidOverscroll(int routing_id,
}
void InputEventFilter::DidStopFlinging(int routing_id) {
+ is_flinging_on_main_ = false;
+ is_flinging_on_impl_ = false;
SendMessage(base::WrapUnique(new InputHostMsg_DidStopFlinging(routing_id)));
}
+void InputEventFilter::DidStartFlinging(bool is_on_impl) {
+ if (is_on_impl)
+ is_flinging_on_impl_ = true;
+ else
+ is_flinging_on_main_ = true;
+}
+
void InputEventFilter::NotifyInputEventHandled(
int routing_id,
blink::WebInputEvent::Type type) {
@@ -183,8 +194,9 @@ void InputEventFilter::ForwardToHandler(const IPC::Message& message) {
DCHECK(!overscroll_params);
RouteQueueMap::iterator iter = route_queues_.find(routing_id);
if (iter != route_queues_.end())
- send_ack &= iter->second->HandleEvent(event, latency_info, dispatch_type,
- ack_state);
+ send_ack &= iter->second->HandleEvent(
+ event, latency_info, dispatch_type, ack_state,
+ (is_flinging_on_main_ || is_flinging_on_impl_));
}
if (!send_ack)

Powered by Google App Engine
This is Rietveld 408576698