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 #ifndef BASE_THREADING_SEQUENCED_WORKER_POOL_TASK_RUNNER_H_ | |
| 6 #define BASE_THREADING_SEQUENCED_WORKER_POOL_TASK_RUNNER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/callback.h" | |
|
akalin
2012/03/26 18:44:08
no need for callback.h include (you could include
Francois
2012/03/28 14:32:42
Done.
| |
| 11 #include "base/compiler_specific.h" | |
| 12 #include "base/memory/ref_counted.h" | |
| 13 #include "base/sequenced_task_runner.h" | |
| 14 #include "base/threading/sequenced_worker_pool.h" | |
| 15 #include "base/time.h" | |
|
akalin
2012/03/26 18:44:08
no need for time.h include (since you're pulling i
Francois
2012/03/28 14:32:42
Yeah but the Google style guide says not to rely o
| |
| 16 | |
| 17 namespace tracked_objects { | |
| 18 class Location; | |
|
akalin
2012/03/26 18:44:08
no need for this forward-declaration (since you're
Francois
2012/03/28 14:32:42
Please see my comment above.
| |
| 19 } // namespace tracked_objects | |
| 20 | |
| 21 namespace base { | |
| 22 | |
| 23 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner). | |
|
akalin
2012/03/26 18:44:08
Add a comment explaining what the class does. Som
Francois
2012/03/28 14:32:42
Done.
| |
| 24 class BASE_EXPORT SequencedWorkerPoolTaskRunner : public SequencedTaskRunner { | |
| 25 public: | |
| 26 SequencedWorkerPoolTaskRunner(const scoped_refptr<SequencedWorkerPool>& pool, | |
| 27 SequencedWorkerPool::SequenceToken token); | |
|
akalin
2012/03/26 18:44:08
fix indent
Francois
2012/03/28 14:32:42
Done.
| |
| 28 | |
| 29 // TaskRunner implementation | |
| 30 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | |
| 31 const Closure& task, | |
| 32 int64 delay_ms) OVERRIDE; | |
| 33 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | |
| 34 const Closure& task, | |
| 35 TimeDelta delay) OVERRIDE; | |
| 36 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; | |
| 37 | |
| 38 // SequencedTaskRunner implementation | |
| 39 virtual bool PostNonNestableDelayedTask( | |
| 40 const tracked_objects::Location& from_here, | |
| 41 const Closure& task, | |
| 42 int64 delay_ms) OVERRIDE; | |
| 43 virtual bool PostNonNestableDelayedTask( | |
| 44 const tracked_objects::Location& from_here, | |
| 45 const Closure& task, | |
| 46 TimeDelta delay) OVERRIDE; | |
| 47 | |
| 48 private: | |
| 49 virtual ~SequencedWorkerPoolTaskRunner(); | |
| 50 | |
| 51 const scoped_refptr<SequencedWorkerPool> pool_; | |
| 52 | |
| 53 const SequencedWorkerPool::SequenceToken token_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPoolTaskRunner); | |
| 56 }; | |
| 57 | |
| 58 } // namespace base | |
| 59 | |
| 60 #endif // BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_ | |
| OLD | NEW |