|
OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
akalin
2012/03/13 07:27:11
This file should probably be live in threading/ si
Francois
2012/03/14 15:43:31
Done.
| |
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_SEQUENCED_TASK_RUNNER_IMPL_H_ | |
akalin
2012/03/13 07:27:11
Conceptually, this class is essentially an inner c
Francois
2012/03/14 15:43:31
Yeah, I agree, the name could use some work. I wil
| |
6 #define BASE_SEQUENCED_TASK_RUNNER_IMPL_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/sequenced_task_runner.h" | |
11 | |
12 namespace base { | |
13 | |
14 class SequencedWorkerPool; | |
15 | |
16 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner). | |
17 class BASE_EXPORT SequencedTaskRunnerImpl : public base::SequencedTaskRunner { | |
18 public: | |
19 explicit SequencedTaskRunnerImpl(scoped_refptr<SequencedWorkerPool> pool); | |
akalin
2012/03/13 07:27:11
I think you should make the token a parameter of t
Francois
2012/03/14 15:43:31
Done.
| |
20 | |
21 // TaskRunner implementation | |
22 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | |
23 const Closure& task, | |
24 int64 delay_ms) OVERRIDE; | |
akalin
2012/03/13 07:27:11
#include compiler_specific.h for OVERRIDE
Francois
2012/03/14 15:43:31
Done.
| |
25 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | |
26 const Closure& task, | |
27 TimeDelta delay) OVERRIDE; | |
28 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; | |
29 | |
30 // SequencedTaskRunner implementation | |
31 virtual bool PostNonNestableDelayedTask( | |
32 const tracked_objects::Location& from_here, | |
33 const Closure& task, | |
34 int64 delay_ms) OVERRIDE; | |
35 virtual bool PostNonNestableDelayedTask( | |
36 const tracked_objects::Location& from_here, | |
37 const Closure& task, | |
38 base::TimeDelta delay) OVERRIDE; | |
39 | |
40 private: | |
41 ~SequencedTaskRunnerImpl(); | |
42 | |
43 scoped_refptr<SequencedWorkerPool> pool_; | |
44 | |
45 class SequenceToken; | |
akalin
2012/03/13 07:27:11
No need to have another class just to avoid includ
Francois
2012/03/14 15:43:31
Done.
| |
46 scoped_ptr<SequenceToken> token_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerImpl); | |
49 }; | |
50 | |
51 } // namespace base | |
52 | |
53 #endif // BASE_SEQUENCED_TASK_RUNNER_IMPL_H_ | |
OLD | NEW |