Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: base/threading/sequenced_worker_pool_task_runner.h

Issue 9663075: Implementation of SequencedTaskRunner based on SequencedWorkerPool. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698