Index: base/threading/sequenced_task_runner_impl.h |
=================================================================== |
--- base/threading/sequenced_task_runner_impl.h (revision 0) |
+++ base/threading/sequenced_task_runner_impl.h (revision 0) |
@@ -0,0 +1,61 @@ |
+// 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_TASK_RUNNER_IMPL_H_ |
+#define BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_ |
+#pragma once |
+ |
+#include "base/compiler_specific.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/memory/weak_ptr.h" |
+#include "base/sequenced_task_runner.h" |
+#include "base/threading/sequenced_worker_pool.h" |
+ |
+namespace base { |
+ |
+// Note that this class is RefCountedThreadSafe (inherited from TaskRunner). |
+class BASE_EXPORT SequencedTaskRunnerImpl |
+ : public base::SequencedTaskRunner, |
+ public base::SupportsWeakPtr<SequencedTaskRunnerImpl> { |
akalin
2012/03/15 19:17:35
It doesn't make sense for a ref-counted-thread-saf
|
+ public: |
+ explicit SequencedTaskRunnerImpl(scoped_refptr<SequencedWorkerPool> pool); |
+ |
+ SequencedTaskRunnerImpl(scoped_refptr<SequencedWorkerPool> pool, |
akalin
2012/03/15 19:17:35
just one constructor, for pool + token
Francois
2012/03/18 16:28:29
Done.
|
+ SequencedWorkerPool::SequenceToken token); |
+ |
+ SequencedTaskRunnerImpl(scoped_refptr<SequencedWorkerPool> pool, |
+ const std::string& token_name); |
+ |
+ // 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, |
+ base::TimeDelta delay) OVERRIDE; |
+ |
+ private: |
+ ~SequencedTaskRunnerImpl(); |
+ |
+ scoped_refptr<SequencedWorkerPool> pool_; |
+ |
+ SequencedWorkerPool::SequenceToken token_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerImpl); |
+}; |
+ |
+} // namespace base |
+ |
+#endif // BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_ |
Property changes on: base/threading/sequenced_task_runner_impl.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |