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

Unified Diff: components/scheduler/child/scheduler_tqm_delegate_impl.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
Index: components/scheduler/child/scheduler_tqm_delegate_impl.cc
diff --git a/components/scheduler/child/scheduler_tqm_delegate_impl.cc b/components/scheduler/child/scheduler_tqm_delegate_impl.cc
deleted file mode 100644
index ee4abcb3341fed4ad604dcea83ef7fb688732605..0000000000000000000000000000000000000000
--- a/components/scheduler/child/scheduler_tqm_delegate_impl.cc
+++ /dev/null
@@ -1,67 +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/child/scheduler_tqm_delegate_impl.h"
-
-#include <utility>
-
-namespace scheduler {
-
-// static
-scoped_refptr<SchedulerTqmDelegateImpl> SchedulerTqmDelegateImpl::Create(
- base::MessageLoop* message_loop,
- std::unique_ptr<base::TickClock> time_source) {
- return make_scoped_refptr(
- new SchedulerTqmDelegateImpl(message_loop, std::move(time_source)));
-}
-
-SchedulerTqmDelegateImpl::SchedulerTqmDelegateImpl(
- base::MessageLoop* message_loop,
- std::unique_ptr<base::TickClock> time_source)
- : message_loop_(message_loop),
- message_loop_task_runner_(message_loop->task_runner()),
- time_source_(std::move(time_source)) {}
-
-SchedulerTqmDelegateImpl::~SchedulerTqmDelegateImpl() {
- RestoreDefaultTaskRunner();
-}
-
-void SchedulerTqmDelegateImpl::SetDefaultTaskRunner(
- scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
- message_loop_->SetTaskRunner(task_runner);
-}
-
-void SchedulerTqmDelegateImpl::RestoreDefaultTaskRunner() {
- if (base::MessageLoop::current() == message_loop_)
- message_loop_->SetTaskRunner(message_loop_task_runner_);
-}
-
-bool SchedulerTqmDelegateImpl::PostDelayedTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) {
- return message_loop_task_runner_->PostDelayedTask(from_here, task, delay);
-}
-
-bool SchedulerTqmDelegateImpl::PostNonNestableDelayedTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) {
- return message_loop_task_runner_->PostNonNestableDelayedTask(from_here, task,
- delay);
-}
-
-bool SchedulerTqmDelegateImpl::RunsTasksOnCurrentThread() const {
- return message_loop_task_runner_->RunsTasksOnCurrentThread();
-}
-
-bool SchedulerTqmDelegateImpl::IsNested() const {
- return message_loop_->IsNested();
-}
-
-base::TimeTicks SchedulerTqmDelegateImpl::NowTicks() {
- return time_source_->NowTicks();
-}
-
-} // namespace scheduler

Powered by Google App Engine
This is Rietveld 408576698