Index: base/sequenced_task_runner_impl.h |
=================================================================== |
--- base/sequenced_task_runner_impl.h (revision 0) |
+++ base/sequenced_task_runner_impl.h (revision 0) |
@@ -0,0 +1,53 @@ |
+// 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.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#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
|
+#define BASE_SEQUENCED_TASK_RUNNER_IMPL_H_ |
+#pragma once |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "base/sequenced_task_runner.h" |
+ |
+namespace base { |
+ |
+class SequencedWorkerPool; |
+ |
+// Note that this class is RefCountedThreadSafe (inherited from TaskRunner). |
+class BASE_EXPORT SequencedTaskRunnerImpl : public base::SequencedTaskRunner { |
+ public: |
+ 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.
|
+ |
+ // TaskRunner implementation |
+ virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
+ const Closure& task, |
+ 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.
|
+ 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, |
+ base::TimeDelta delay) OVERRIDE; |
+ |
+ private: |
+ ~SequencedTaskRunnerImpl(); |
+ |
+ scoped_refptr<SequencedWorkerPool> pool_; |
+ |
+ 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.
|
+ scoped_ptr<SequenceToken> token_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerImpl); |
+}; |
+ |
+} // namespace base |
+ |
+#endif // BASE_SEQUENCED_TASK_RUNNER_IMPL_H_ |
Property changes on: base/sequenced_task_runner_impl.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |