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

Side by Side Diff: base/threading/worker_pool.cc

Issue 1048373003: CancelableTaskTracker::PostDelayedTask() support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary base:: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/threading/post_task_and_reply_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/worker_pool.h" 5 #include "base/threading/worker_pool.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/debug/leak_annotations.h" 9 #include "base/debug/leak_annotations.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 10 matching lines...) Expand all
21 explicit PostTaskAndReplyWorkerPool(bool task_is_slow) 21 explicit PostTaskAndReplyWorkerPool(bool task_is_slow)
22 : task_is_slow_(task_is_slow) { 22 : task_is_slow_(task_is_slow) {
23 } 23 }
24 24
25 private: 25 private:
26 bool PostTask(const tracked_objects::Location& from_here, 26 bool PostTask(const tracked_objects::Location& from_here,
27 const Closure& task) override { 27 const Closure& task) override {
28 return WorkerPool::PostTask(from_here, task, task_is_slow_); 28 return WorkerPool::PostTask(from_here, task, task_is_slow_);
29 } 29 }
30 30
31 bool PostDelayedTask(
32 const tracked_objects::Location& from_here,
33 const Closure& task,
34 const TimeDelta& delay) override {
35 DLOG(ERROR) << "PostDelayedTask is not supported in WorkerPool.";
36 return false;
37 }
38
31 bool task_is_slow_; 39 bool task_is_slow_;
32 }; 40 };
33 41
34 // WorkerPoolTaskRunner --------------------------------------------- 42 // WorkerPoolTaskRunner ---------------------------------------------
35 // A TaskRunner which posts tasks to a WorkerPool with a 43 // A TaskRunner which posts tasks to a WorkerPool with a
36 // fixed ShutdownBehavior. 44 // fixed ShutdownBehavior.
37 // 45 //
38 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner). 46 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner).
39 class WorkerPoolTaskRunner : public TaskRunner { 47 class WorkerPoolTaskRunner : public TaskRunner {
40 public: 48 public:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 from_here, task, reply); 123 from_here, task, reply);
116 } 124 }
117 125
118 // static 126 // static
119 const scoped_refptr<TaskRunner>& 127 const scoped_refptr<TaskRunner>&
120 WorkerPool::GetTaskRunner(bool tasks_are_slow) { 128 WorkerPool::GetTaskRunner(bool tasks_are_slow) {
121 return g_taskrunners.Get().taskrunners_[tasks_are_slow]; 129 return g_taskrunners.Get().taskrunners_[tasks_are_slow];
122 } 130 }
123 131
124 } // namespace base 132 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/post_task_and_reply_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698