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

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

Issue 1223163006: Implement PostDelayedTaskAt for guaranteed timer ordering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing include to IdleHelperTest. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/scheduler/child/null_task_queue.h ('k') | components/scheduler/child/null_worker_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/child/null_task_queue.cc
diff --git a/components/scheduler/child/null_task_queue.cc b/components/scheduler/child/null_task_queue.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ef5bab5095e85cc7a334e33db19ecba69133eeb8
--- /dev/null
+++ b/components/scheduler/child/null_task_queue.cc
@@ -0,0 +1,41 @@
+// 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/null_task_queue.h"
+
+namespace scheduler {
+
+NullTaskQueue::NullTaskQueue(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner)
+ : task_runner_(task_runner) {}
+
+NullTaskQueue::~NullTaskQueue() {}
+
+bool NullTaskQueue::RunsTasksOnCurrentThread() const {
+ return task_runner_->RunsTasksOnCurrentThread();
+}
+
+bool NullTaskQueue::PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
+ return task_runner_->PostDelayedTask(from_here, task, delay);
+}
+
+bool NullTaskQueue::PostNonNestableDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) {
+ return task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
+}
+bool NullTaskQueue::PostDelayedTaskAt(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeTicks desired_run_time) {
+ // Note: this loses the guarantee of monotonicity but we can't do any better
+ // with base::TaskRunner.
+ return task_runner_->PostDelayedTask(
+ from_here, task, desired_run_time - base::TimeTicks::Now());
+}
+
+} // namespace scheduler
« no previous file with comments | « components/scheduler/child/null_task_queue.h ('k') | components/scheduler/child/null_worker_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698