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

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

Issue 2273703002: Force events to be non blocking if main thread is unresponsive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/main_thread_event_queue.cc
diff --git a/content/renderer/input/main_thread_event_queue.cc b/content/renderer/input/main_thread_event_queue.cc
index 8c1b8675cfafb469d36ae1841c51a4d9256fe32e..4992872821c0da7c87b7d7e6364f2cfab245b51e 100644
--- a/content/renderer/input/main_thread_event_queue.cc
+++ b/content/renderer/input/main_thread_event_queue.cc
@@ -46,6 +46,9 @@ MainThreadEventQueue::MainThreadEventQueue(
last_touch_start_forced_nonblocking_due_to_fling_(false),
enable_fling_passive_listener_flag_(base::FeatureList::IsEnabled(
features::kPassiveEventListenersDueToFling)),
+ enable_non_blocking_due_to_main_thread_responsiveness_flag_(
+ base::FeatureList::IsEnabled(
+ features::kMainThreadBusyScrollIntervention)),
main_task_runner_(main_task_runner),
renderer_scheduler_(renderer_scheduler) {}
@@ -91,6 +94,18 @@ bool MainThreadEventQueue::HandleEvent(
last_touch_start_forced_nonblocking_due_to_fling_ = true;
}
}
+
+ if (enable_non_blocking_due_to_main_thread_responsiveness_flag_ &&
+ touch_event->dispatchType == blink::WebInputEvent::Blocking) {
+ bool passive_due_to_unresponsive_main =
+ renderer_scheduler_
+ ->ShouldForceEventsNonBlockingForUnresponsiveMainThread();
+ if (passive_due_to_unresponsive_main) {
+ touch_event->dispatchType = blink::WebInputEvent::
+ ListenersForcedNonBlockingDueToMainThreadResponsiveness;
+ non_blocking = true;
+ }
+ }
}
if (is_wheel && non_blocking) {
// Adjust the |dispatchType| on the event since the compositor

Powered by Google App Engine
This is Rietveld 408576698