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

Unified Diff: components/scheduler/child/idle_helper.cc

Issue 1432263002: (reland) Adds TimeDomains to the TaskQueueManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix thread_hop_task DCHECK Created 5 years, 1 month 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: components/scheduler/child/idle_helper.cc
diff --git a/components/scheduler/child/idle_helper.cc b/components/scheduler/child/idle_helper.cc
index 84f61712e0baf52782ee53f443facbef2200fa4d..f007baec665c1234173c7ebc2a37f773a9709017 100644
--- a/components/scheduler/child/idle_helper.cc
+++ b/components/scheduler/child/idle_helper.cc
@@ -7,6 +7,7 @@
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
+#include "components/scheduler/base/real_time_domain.h"
#include "components/scheduler/base/task_queue.h"
#include "components/scheduler/base/task_queue_manager.h"
#include "components/scheduler/child/scheduler_helper.h"
@@ -76,17 +77,17 @@ IdleHelper::IdlePeriodState IdleHelper::ComputeNewLongIdlePeriodState(
return IdlePeriodState::NOT_IN_IDLE_PERIOD;
}
- base::TimeTicks next_pending_delayed_task =
- helper_->NextPendingDelayedTaskRunTime();
+ base::TimeTicks next_pending_delayed_task;
base::TimeDelta max_long_idle_period_duration =
base::TimeDelta::FromMilliseconds(kMaximumIdlePeriodMillis);
base::TimeDelta long_idle_period_duration;
- if (next_pending_delayed_task.is_null()) {
- long_idle_period_duration = max_long_idle_period_duration;
- } else {
+ if (helper_->real_time_domain()->NextScheduledRunTime(
+ &next_pending_delayed_task)) {
// Limit the idle period duration to be before the next pending task.
long_idle_period_duration = std::min(next_pending_delayed_task - now,
max_long_idle_period_duration);
+ } else {
+ long_idle_period_duration = max_long_idle_period_duration;
}
if (long_idle_period_duration >=
« no previous file with comments | « components/scheduler/base/virtual_time_domain.cc ('k') | components/scheduler/child/idle_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698