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

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

Issue 2581243004: Pass main thread responsiveness threshold via Finch (Closed)
Patch Set: Created 4 years 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 fe67fb2466804494a736e32a1b1aba62e2d960eb..92961c13079f52bea3eed03424ed13c8b47e662c 100644
--- a/content/renderer/input/main_thread_event_queue.cc
+++ b/content/renderer/input/main_thread_event_queue.cc
@@ -5,6 +5,8 @@
#include "content/renderer/input/main_thread_event_queue.h"
#include "base/metrics/histogram_macros.h"
+#include "base/strings/string_number_conversions.h"
+#include "components/variations/variations_associated_data.h"
#include "content/common/input/event_with_latency_info.h"
#include "content/common/input_messages.h"
@@ -78,7 +80,20 @@ MainThreadEventQueue::MainThreadEventQueue(
handle_raf_aligned_mouse_input_(
base::FeatureList::IsEnabled(features::kRafAlignedMouseInputEvents)),
main_task_runner_(main_task_runner),
- renderer_scheduler_(renderer_scheduler) {}
+ renderer_scheduler_(renderer_scheduler) {
+ if (enable_non_blocking_due_to_main_thread_responsiveness_flag_) {
+ std::string threshold = variations::GetVariationParamValueByFeature(
+ features::kMainThreadBusyScrollIntervention, "threshold");
+ int threshold_ms = 0;
+ base::StringToInt(threshold, &threshold_ms);
+ if (!threshold_ms) {
+ enable_non_blocking_due_to_main_thread_responsiveness_flag_ = false;
dtapuska 2016/12/16 19:59:46 What about negative values? And StringToInt failin
tdresser 2016/12/16 20:12:08 StringToInt saturates for overflow and underflow,
+ } else {
+ main_thread_responsiveness_threshold_ =
+ base::TimeDelta::FromMilliseconds(threshold_ms);
+ }
+ }
+}
MainThreadEventQueue::~MainThreadEventQueue() {}
@@ -133,7 +148,8 @@ bool MainThreadEventQueue::HandleEvent(
if (enable_non_blocking_due_to_main_thread_responsiveness_flag_ &&
touch_event->dispatchType == blink::WebInputEvent::Blocking) {
bool passive_due_to_unresponsive_main =
- renderer_scheduler_->MainThreadSeemsUnresponsive();
+ renderer_scheduler_->MainThreadSeemsUnresponsive(
+ main_thread_responsiveness_threshold_);
if (passive_due_to_unresponsive_main) {
touch_event->dispatchType = blink::WebInputEvent::
ListenersForcedNonBlockingDueToMainThreadResponsiveness;

Powered by Google App Engine
This is Rietveld 408576698