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

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

Issue 2581243004: Pass main thread responsiveness threshold via Finch (Closed)
Patch Set: Fix negative threshold, BUILD.gn 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..7a971da6969f5a13ad012b0f3790b09dca447cb8 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(
Sami 2016/12/19 16:05:26 Are you sure this works? The comment here says thi
+ features::kMainThreadBusyScrollIntervention, "threshold");
+ int threshold_ms = 0;
+ base::StringToInt(threshold, &threshold_ms);
+ if (threshold_ms <= 0) {
+ enable_non_blocking_due_to_main_thread_responsiveness_flag_ = false;
+ } 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