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_TASK_RUNNER_IMPL_H_ | |
|
akalin
2012/03/20 22:16:08
After thinking about it, I think the best name for
Francois
2012/03/26 09:33:21
Done. I haven't managed to think of anything bette
| |
| 6 #define BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
|
akalin
2012/03/20 22:16:08
remove scoped_ptr include, add ref_counted.h inclu
Francois
2012/03/26 09:33:21
Done.
| |
| 11 #include "base/sequenced_task_runner.h" | |
| 12 #include "base/threading/sequenced_worker_pool.h" | |
| 13 | |
| 14 namespace base { | |
| 15 | |
| 16 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner). | |
| 17 class BASE_EXPORT SequencedTaskRunnerImpl : public base::SequencedTaskRunner { | |
|
akalin
2012/03/20 22:16:08
remove base::
Francois
2012/03/26 09:33:21
Done.
| |
| 18 public: | |
|
akalin
2012/03/20 22:16:08
indent one space
Francois
2012/03/26 09:33:21
Done. Looks like the presence of BASE_EXPORT cause
| |
| 19 SequencedTaskRunnerImpl(scoped_refptr<SequencedWorkerPool> pool, | |
|
akalin
2012/03/20 22:16:08
use const scoped_refptr<...>&
Francois
2012/03/26 09:33:21
Done. Is the goal to eliminate the extra ref++ and
| |
| 20 SequencedWorkerPool::SequenceToken token); | |
| 21 | |
| 22 // TaskRunner implementation | |
| 23 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | |
| 24 const Closure& task, | |
| 25 int64 delay_ms) OVERRIDE; | |
| 26 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | |
| 27 const Closure& task, | |
| 28 TimeDelta delay) OVERRIDE; | |
| 29 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; | |
| 30 | |
| 31 // SequencedTaskRunner implementation | |
| 32 virtual bool PostNonNestableDelayedTask( | |
| 33 const tracked_objects::Location& from_here, | |
| 34 const Closure& task, | |
| 35 int64 delay_ms) OVERRIDE; | |
| 36 virtual bool PostNonNestableDelayedTask( | |
| 37 const tracked_objects::Location& from_here, | |
| 38 const Closure& task, | |
| 39 base::TimeDelta delay) OVERRIDE; | |
|
akalin
2012/03/20 22:16:08
remove base::
Francois
2012/03/26 09:33:21
Done.
| |
| 40 | |
| 41 private: | |
|
akalin
2012/03/20 22:16:08
indent one space
Francois
2012/03/26 09:33:21
Done.
| |
| 42 ~SequencedTaskRunnerImpl(); | |
|
akalin
2012/03/20 22:16:08
destructor needs to be virtual
Francois
2012/03/26 09:33:21
Done.
| |
| 43 | |
| 44 scoped_refptr<SequencedWorkerPool> pool_; | |
|
akalin
2012/03/20 22:16:08
make this const
Francois
2012/03/26 09:33:21
Done.
| |
| 45 | |
| 46 SequencedWorkerPool::SequenceToken token_; | |
|
akalin
2012/03/20 22:16:08
this, too
Francois
2012/03/26 09:33:21
Done.
| |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerImpl); | |
|
akalin
2012/03/20 22:16:08
need #include "base/basictypes.h" for this
Francois
2012/03/26 09:33:21
Done.
| |
| 49 }; | |
| 50 | |
| 51 } // namespace base | |
| 52 | |
| 53 #endif // BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_ | |
| OLD | NEW |