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

Unified Diff: components/scheduler/base/real_time_domain.cc

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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
« no previous file with comments | « components/scheduler/base/real_time_domain.h ('k') | components/scheduler/base/task_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/base/real_time_domain.cc
diff --git a/components/scheduler/base/real_time_domain.cc b/components/scheduler/base/real_time_domain.cc
deleted file mode 100644
index a452b978e9179cdec412463837625846cc7dbbdf..0000000000000000000000000000000000000000
--- a/components/scheduler/base/real_time_domain.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/scheduler/base/real_time_domain.h"
-
-#include "base/bind.h"
-#include "components/scheduler/base/task_queue_impl.h"
-#include "components/scheduler/base/task_queue_manager.h"
-#include "components/scheduler/base/task_queue_manager_delegate.h"
-
-namespace scheduler {
-
-RealTimeDomain::RealTimeDomain(const char* tracing_category)
- : TimeDomain(nullptr),
- tracing_category_(tracing_category),
- task_queue_manager_(nullptr) {}
-
-RealTimeDomain::RealTimeDomain(TimeDomain::Observer* observer,
- const char* tracing_category)
- : TimeDomain(observer),
- tracing_category_(tracing_category),
- task_queue_manager_(nullptr) {}
-
-RealTimeDomain::~RealTimeDomain() {}
-
-void RealTimeDomain::OnRegisterWithTaskQueueManager(
- TaskQueueManager* task_queue_manager) {
- task_queue_manager_ = task_queue_manager;
- DCHECK(task_queue_manager_);
-}
-
-LazyNow RealTimeDomain::CreateLazyNow() const {
- return task_queue_manager_->CreateLazyNow();
-}
-
-base::TimeTicks RealTimeDomain::Now() const {
- return task_queue_manager_->delegate()->NowTicks();
-}
-
-void RealTimeDomain::RequestWakeup(base::TimeTicks now, base::TimeDelta delay) {
- // NOTE this is only called if the scheduled runtime is sooner than any
- // previously scheduled runtime, or there is no (outstanding) previously
- // scheduled runtime.
- task_queue_manager_->MaybeScheduleDelayedWork(FROM_HERE, now, delay);
-}
-
-bool RealTimeDomain::MaybeAdvanceTime() {
- base::TimeTicks next_run_time;
- if (!NextScheduledRunTime(&next_run_time))
- return false;
-
- base::TimeTicks now = Now();
- if (now >= next_run_time)
- return true; // Causes DoWork to post a continuation.
-
- base::TimeDelta delay = next_run_time - now;
- TRACE_EVENT1(tracing_category_, "RealTimeDomain::MaybeAdvanceTime",
- "delay_ms", delay.InMillisecondsF());
-
- // The next task is sometime in the future, make sure we schedule a DoWork to
- // run it.
- task_queue_manager_->MaybeScheduleDelayedWork(FROM_HERE, now, delay);
- return false;
-}
-
-void RealTimeDomain::AsValueIntoInternal(
- base::trace_event::TracedValue* state) const {}
-
-const char* RealTimeDomain::GetName() const {
- return "RealTimeDomain";
-}
-} // namespace scheduler
« no previous file with comments | « components/scheduler/base/real_time_domain.h ('k') | components/scheduler/base/task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698