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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/scheduler/child/null_task_queue.h"
6
7 namespace scheduler {
8
9 NullTaskQueue::NullTaskQueue(
10 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
11 : task_runner_(task_runner) {}
12
13 NullTaskQueue::~NullTaskQueue() {}
14
15 bool NullTaskQueue::RunsTasksOnCurrentThread() const {
16 return task_runner_->RunsTasksOnCurrentThread();
17 }
18
19 bool NullTaskQueue::PostDelayedTask(const tracked_objects::Location& from_here,
20 const base::Closure& task,
21 base::TimeDelta delay) {
22 return task_runner_->PostDelayedTask(from_here, task, delay);
23 }
24
25 bool NullTaskQueue::PostNonNestableDelayedTask(
26 const tracked_objects::Location& from_here,
27 const base::Closure& task,
28 base::TimeDelta delay) {
29 return task_runner_->PostNonNestableDelayedTask(from_here, task, delay);
30 }
31 bool NullTaskQueue::PostDelayedTaskAt(
32 const tracked_objects::Location& from_here,
33 const base::Closure& task,
34 base::TimeTicks desired_run_time) {
35 // Note: this loses the guarantee of monotonicity but we can't do any better
36 // with base::TaskRunner.
37 return task_runner_->PostDelayedTask(
38 from_here, task, desired_run_time - base::TimeTicks::Now());
39 }
40
41 } // namespace scheduler
OLDNEW
« 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