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

Unified Diff: base/threading/sequenced_task_runner_impl.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_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,53 @@
+// 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_
akalin 2012/03/20 22:16:08 After thinking about it, I think the best name for
Francois 2012/03/26 09:33:21 Done. I haven't managed to think of anything bette
+#define BASE_THREADING_SEQUENCED_TASK_RUNNER_IMPL_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
akalin 2012/03/20 22:16:08 remove scoped_ptr include, add ref_counted.h inclu
Francois 2012/03/26 09:33:21 Done.
+#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 {
akalin 2012/03/20 22:16:08 remove base::
Francois 2012/03/26 09:33:21 Done.
+public:
akalin 2012/03/20 22:16:08 indent one space
Francois 2012/03/26 09:33:21 Done. Looks like the presence of BASE_EXPORT cause
+ SequencedTaskRunnerImpl(scoped_refptr<SequencedWorkerPool> pool,
akalin 2012/03/20 22:16:08 use const scoped_refptr<...>&
Francois 2012/03/26 09:33:21 Done. Is the goal to eliminate the extra ref++ and
+ SequencedWorkerPool::SequenceToken token);
+
+ // 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;
akalin 2012/03/20 22:16:08 remove base::
Francois 2012/03/26 09:33:21 Done.
+
+private:
akalin 2012/03/20 22:16:08 indent one space
Francois 2012/03/26 09:33:21 Done.
+ ~SequencedTaskRunnerImpl();
akalin 2012/03/20 22:16:08 destructor needs to be virtual
Francois 2012/03/26 09:33:21 Done.
+
+ scoped_refptr<SequencedWorkerPool> pool_;
akalin 2012/03/20 22:16:08 make this const
Francois 2012/03/26 09:33:21 Done.
+
+ SequencedWorkerPool::SequenceToken token_;
akalin 2012/03/20 22:16:08 this, too
Francois 2012/03/26 09:33:21 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(SequencedTaskRunnerImpl);
akalin 2012/03/20 22:16:08 need #include "base/basictypes.h" for this
Francois 2012/03/26 09:33:21 Done.
+};
+
+} // 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

Powered by Google App Engine
This is Rietveld 408576698