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

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

Issue 1424053002: Adds a flag to support "Virtual Time" to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased 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/scheduler_tqm_delegate_for_test.cc
diff --git a/components/scheduler/child/scheduler_tqm_delegate_for_test.cc b/components/scheduler/child/scheduler_tqm_delegate_for_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4ff373f5939680446a0730179455f3c961cd4516
--- /dev/null
+++ b/components/scheduler/child/scheduler_tqm_delegate_for_test.cc
@@ -0,0 +1,67 @@
+// 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_for_test.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "components/scheduler/base/task_queue_manager_delegate_for_test.h"
+
+namespace scheduler {
+
+// static
+scoped_refptr<SchedulerTqmDelegateForTest> SchedulerTqmDelegateForTest::Create(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ scoped_ptr<base::TickClock> time_source) {
+ return make_scoped_refptr(
+ new SchedulerTqmDelegateForTest(task_runner, time_source.Pass()));
+}
+
+SchedulerTqmDelegateForTest::SchedulerTqmDelegateForTest(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ scoped_ptr<base::TickClock> time_source)
+ : task_runner_(
+ TaskQueueManagerDelegateForTest::Create(task_runner,
+ time_source.Pass())) {}
+
+SchedulerTqmDelegateForTest::~SchedulerTqmDelegateForTest() {}
+
+void SchedulerTqmDelegateForTest::SetDefaultTaskRunner(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+ default_task_runner_ = task_runner.Pass();
+}
+
+void SchedulerTqmDelegateForTest::RestoreDefaultTaskRunner() {
+ default_task_runner_ = nullptr;
+}
+
+bool SchedulerTqmDelegateForTest::PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
+ return task_runner_->PostDelayedTask(from_here, task, delay);
+}
+
+bool SchedulerTqmDelegateForTest::PostNonNestableDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
+ return task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
+}
+
+bool SchedulerTqmDelegateForTest::RunsTasksOnCurrentThread() const {
+ return task_runner_->RunsTasksOnCurrentThread();
+}
+
+bool SchedulerTqmDelegateForTest::IsNested() const {
+ return task_runner_->IsNested();
+}
+
+base::TimeTicks SchedulerTqmDelegateForTest::NowTicks() {
+ return task_runner_->NowTicks();
+}
+
+void SchedulerTqmDelegateForTest::OnNoMoreImmediateWork() {}
+
+} // namespace scheduler
« no previous file with comments | « components/scheduler/child/scheduler_tqm_delegate_for_test.h ('k') | components/scheduler/child/scheduler_tqm_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698