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

Side by Side Diff: components/scheduler/child/idle_helper.cc

Issue 2155143002: Fix a bug that could occasionaly cause setInterval to stop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ClearExpiredWakeups tweak. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/scheduler/child/idle_helper.h" 5 #include "components/scheduler/child/idle_helper.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 #include "components/scheduler/base/real_time_domain.h" 10 #include "components/scheduler/base/real_time_domain.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 base::TimeDelta::FromMilliseconds(kMinimumIdlePeriodDurationMillis)) { 169 base::TimeDelta::FromMilliseconds(kMinimumIdlePeriodDurationMillis)) {
170 TRACE_EVENT1(disabled_by_default_tracing_category_, 170 TRACE_EVENT1(disabled_by_default_tracing_category_,
171 "NotStartingIdlePeriodBecauseDeadlineIsTooClose", 171 "NotStartingIdlePeriodBecauseDeadlineIsTooClose",
172 "idle_period_duration_ms", 172 "idle_period_duration_ms",
173 idle_period_duration.InMillisecondsF()); 173 idle_period_duration.InMillisecondsF());
174 return; 174 return;
175 } 175 }
176 176
177 TRACE_EVENT0(disabled_by_default_tracing_category_, "StartIdlePeriod"); 177 TRACE_EVENT0(disabled_by_default_tracing_category_, "StartIdlePeriod");
178 idle_queue_->SetQueueEnabled(true); 178 idle_queue_->SetQueueEnabled(true);
179 idle_queue_->PumpQueue(true); 179 LazyNow lazy_now(now);
180 idle_queue_->PumpQueue(&lazy_now, true);
180 181
181 state_.UpdateState(new_state, idle_period_deadline, now); 182 state_.UpdateState(new_state, idle_period_deadline, now);
182 } 183 }
183 184
184 void IdleHelper::EndIdlePeriod() { 185 void IdleHelper::EndIdlePeriod() {
185 helper_->CheckOnValidThread(); 186 helper_->CheckOnValidThread();
186 TRACE_EVENT0(disabled_by_default_tracing_category_, "EndIdlePeriod"); 187 TRACE_EVENT0(disabled_by_default_tracing_category_, "EndIdlePeriod");
187 188
188 enable_next_long_idle_period_closure_.Cancel(); 189 enable_next_long_idle_period_closure_.Cancel();
189 on_idle_task_posted_closure_.Cancel(); 190 on_idle_task_posted_closure_.Cancel();
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 return "in_long_idle_period_with_max_deadline"; 477 return "in_long_idle_period_with_max_deadline";
477 case IdlePeriodState::IN_LONG_IDLE_PERIOD_PAUSED: 478 case IdlePeriodState::IN_LONG_IDLE_PERIOD_PAUSED:
478 return "in_long_idle_period_paused"; 479 return "in_long_idle_period_paused";
479 default: 480 default:
480 NOTREACHED(); 481 NOTREACHED();
481 return nullptr; 482 return nullptr;
482 } 483 }
483 } 484 }
484 485
485 } // namespace scheduler 486 } // namespace scheduler
OLDNEW
« no previous file with comments | « components/scheduler/child/compositor_worker_scheduler.cc ('k') | components/scheduler/child/scheduler_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698