Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 "base/threading/sequenced_task_runner_impl.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "base/threading/sequenced_worker_pool.h" | |
| 9 | |
| 10 namespace base { | |
| 11 | |
| 12 SequencedTaskRunnerImpl::SequencedTaskRunnerImpl( | |
| 13 scoped_refptr<SequencedWorkerPool> pool, | |
| 14 SequencedWorkerPool::SequenceToken token) | |
| 15 : pool_(pool), | |
| 16 token_(token) { | |
| 17 } | |
| 18 | |
| 19 SequencedTaskRunnerImpl::~SequencedTaskRunnerImpl() { | |
| 20 } | |
| 21 | |
| 22 bool SequencedTaskRunnerImpl::PostDelayedTask( | |
| 23 const tracked_objects::Location& from_here, | |
| 24 const Closure& task, | |
| 25 int64 delay_ms) { | |
| 26 return pool_->PostDelayedTask(from_here, task, delay_ms); | |
|
akalin
2012/03/19 09:34:21
PostDelayedTask -> PostSequencedWorkerTask
Francois
2012/03/20 14:22:43
Done.
| |
| 27 } | |
| 28 | |
| 29 bool SequencedTaskRunnerImpl::PostDelayedTask( | |
| 30 const tracked_objects::Location& from_here, | |
| 31 const Closure& task, | |
| 32 TimeDelta delay) { | |
| 33 return pool_->PostDelayedTask(from_here, task, delay); | |
|
akalin
2012/03/19 09:34:21
PostDelayedTask -> PostSequencedWorkerTask
Francois
2012/03/20 14:22:43
Done.
| |
| 34 } | |
| 35 | |
| 36 bool SequencedTaskRunnerImpl::RunsTasksOnCurrentThread() const { | |
| 37 return pool_->RunsTasksOnCurrentThread(); | |
| 38 } | |
| 39 | |
| 40 bool SequencedTaskRunnerImpl::PostNonNestableDelayedTask( | |
| 41 const tracked_objects::Location& from_here, | |
| 42 const Closure& task, | |
| 43 int64 delay_ms) { | |
| 44 // TODO(francoisk777@gmail.com): Change the following two statements once | |
| 45 // SequencedWorkerPool supports non-zero delays. | |
| 46 DLOG_IF(WARNING, delay_ms > 0) << "SequencedTaskRunnerImpl does not yet " | |
| 47 "support non-zero delays; ignoring delay of " << delay_ms << " ms"; | |
|
Francois
2012/03/18 16:28:29
I shouldn't have changed this back; I will fix it
Francois
2012/03/20 14:22:43
Done.
| |
| 48 return pool_->PostSequencedWorkerTask(token_, from_here, task); | |
| 49 } | |
| 50 | |
| 51 bool SequencedTaskRunnerImpl::PostNonNestableDelayedTask( | |
| 52 const tracked_objects::Location& from_here, | |
| 53 const Closure& task, | |
| 54 base::TimeDelta delay) { | |
| 55 // TODO(francoisk777@gmail.com): Change the following two statements once | |
| 56 // SequencedWorkerPool supports non-zero delays. | |
| 57 DLOG_IF(WARNING, delay.InMillisecondsRoundedUp() > 0) | |
| 58 << "SequencedTaskRunnerImpl does not yet support non-zero delays; " | |
| 59 "ignoring delay of " << delay.InMillisecondsRoundedUp(); | |
|
Francois
2012/03/18 16:28:29
I shouldn't have changed this back; I will fix it
Francois
2012/03/20 14:22:43
Done.
| |
| 60 return pool_->PostSequencedWorkerTask(token_, from_here, task); | |
| 61 } | |
| 62 | |
| 63 } // namespace base | |
| OLD | NEW |