Chromium Code Reviews| Index: base/threading/sequenced_worker_pool_task_runner.h |
| =================================================================== |
| --- base/threading/sequenced_worker_pool_task_runner.h (revision 0) |
| +++ base/threading/sequenced_worker_pool_task_runner.h (revision 0) |
| @@ -0,0 +1,60 @@ |
| +// Copyright (c) 2012 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. |
| + |
| +#ifndef BASE_THREADING_SEQUENCED_WORKER_POOL_TASK_RUNNER_H_ |
| +#define BASE_THREADING_SEQUENCED_WORKER_POOL_TASK_RUNNER_H_ |
| +#pragma once |
| + |
| +#include "base/basictypes.h" |
| +#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.
|
| +#include "base/compiler_specific.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/sequenced_task_runner.h" |
| +#include "base/threading/sequenced_worker_pool.h" |
| +#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
|
| + |
| +namespace tracked_objects { |
| +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.
|
| +} // namespace tracked_objects |
| + |
| +namespace base { |
| + |
| +// 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.
|
| +class BASE_EXPORT SequencedWorkerPoolTaskRunner : public SequencedTaskRunner { |
| + public: |
| + SequencedWorkerPoolTaskRunner(const scoped_refptr<SequencedWorkerPool>& pool, |
| + SequencedWorkerPool::SequenceToken token); |
|
akalin
2012/03/26 18:44:08
fix indent
Francois
2012/03/28 14:32:42
Done.
|
| + |
| + // TaskRunner implementation |
| + virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
| + const Closure& task, |
| + int64 delay_ms) OVERRIDE; |
| + virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
| + const Closure& task, |
| + TimeDelta delay) OVERRIDE; |
| + virtual bool RunsTasksOnCurrentThread() const OVERRIDE; |
| + |
| + // SequencedTaskRunner implementation |
| + virtual bool PostNonNestableDelayedTask( |
| + const tracked_objects::Location& from_here, |
| + const Closure& task, |
| + int64 delay_ms) OVERRIDE; |
| + virtual bool PostNonNestableDelayedTask( |
| + const tracked_objects::Location& from_here, |
| + const Closure& task, |
| + TimeDelta delay) OVERRIDE; |
| + |
| + private: |
| + virtual ~SequencedWorkerPoolTaskRunner(); |
| + |
| + const scoped_refptr<SequencedWorkerPool> pool_; |
| + |
| + const SequencedWorkerPool::SequenceToken token_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPoolTaskRunner); |
| +}; |
| + |
| +} // namespace base |
| + |
| +#endif // BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_ |
| Property changes on: base/threading/sequenced_worker_pool_task_runner.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |