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

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

Issue 611153004: replace OVERRIDE and FINAL with override and final in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CC_ -> BASE_ Created 6 years, 2 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
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/sequenced_worker_pool.h" 5 #include "base/threading/sequenced_worker_pool.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner). 93 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner).
94 class SequencedWorkerPoolTaskRunner : public TaskRunner { 94 class SequencedWorkerPoolTaskRunner : public TaskRunner {
95 public: 95 public:
96 SequencedWorkerPoolTaskRunner( 96 SequencedWorkerPoolTaskRunner(
97 const scoped_refptr<SequencedWorkerPool>& pool, 97 const scoped_refptr<SequencedWorkerPool>& pool,
98 SequencedWorkerPool::WorkerShutdown shutdown_behavior); 98 SequencedWorkerPool::WorkerShutdown shutdown_behavior);
99 99
100 // TaskRunner implementation 100 // TaskRunner implementation
101 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, 101 virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
102 const Closure& task, 102 const Closure& task,
103 TimeDelta delay) OVERRIDE; 103 TimeDelta delay) override;
104 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; 104 virtual bool RunsTasksOnCurrentThread() const override;
105 105
106 private: 106 private:
107 virtual ~SequencedWorkerPoolTaskRunner(); 107 virtual ~SequencedWorkerPoolTaskRunner();
108 108
109 const scoped_refptr<SequencedWorkerPool> pool_; 109 const scoped_refptr<SequencedWorkerPool> pool_;
110 110
111 const SequencedWorkerPool::WorkerShutdown shutdown_behavior_; 111 const SequencedWorkerPool::WorkerShutdown shutdown_behavior_;
112 112
113 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPoolTaskRunner); 113 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPoolTaskRunner);
114 }; 114 };
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 class SequencedWorkerPoolSequencedTaskRunner : public SequencedTaskRunner { 146 class SequencedWorkerPoolSequencedTaskRunner : public SequencedTaskRunner {
147 public: 147 public:
148 SequencedWorkerPoolSequencedTaskRunner( 148 SequencedWorkerPoolSequencedTaskRunner(
149 const scoped_refptr<SequencedWorkerPool>& pool, 149 const scoped_refptr<SequencedWorkerPool>& pool,
150 SequencedWorkerPool::SequenceToken token, 150 SequencedWorkerPool::SequenceToken token,
151 SequencedWorkerPool::WorkerShutdown shutdown_behavior); 151 SequencedWorkerPool::WorkerShutdown shutdown_behavior);
152 152
153 // TaskRunner implementation 153 // TaskRunner implementation
154 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, 154 virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
155 const Closure& task, 155 const Closure& task,
156 TimeDelta delay) OVERRIDE; 156 TimeDelta delay) override;
157 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; 157 virtual bool RunsTasksOnCurrentThread() const override;
158 158
159 // SequencedTaskRunner implementation 159 // SequencedTaskRunner implementation
160 virtual bool PostNonNestableDelayedTask( 160 virtual bool PostNonNestableDelayedTask(
161 const tracked_objects::Location& from_here, 161 const tracked_objects::Location& from_here,
162 const Closure& task, 162 const Closure& task,
163 TimeDelta delay) OVERRIDE; 163 TimeDelta delay) override;
164 164
165 private: 165 private:
166 virtual ~SequencedWorkerPoolSequencedTaskRunner(); 166 virtual ~SequencedWorkerPoolSequencedTaskRunner();
167 167
168 const scoped_refptr<SequencedWorkerPool> pool_; 168 const scoped_refptr<SequencedWorkerPool> pool_;
169 169
170 const SequencedWorkerPool::SequenceToken token_; 170 const SequencedWorkerPool::SequenceToken token_;
171 171
172 const SequencedWorkerPool::WorkerShutdown shutdown_behavior_; 172 const SequencedWorkerPool::WorkerShutdown shutdown_behavior_;
173 173
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 class SequencedWorkerPool::Worker : public SimpleThread { 231 class SequencedWorkerPool::Worker : public SimpleThread {
232 public: 232 public:
233 // Hold a (cyclic) ref to |worker_pool|, since we want to keep it 233 // Hold a (cyclic) ref to |worker_pool|, since we want to keep it
234 // around as long as we are running. 234 // around as long as we are running.
235 Worker(const scoped_refptr<SequencedWorkerPool>& worker_pool, 235 Worker(const scoped_refptr<SequencedWorkerPool>& worker_pool,
236 int thread_number, 236 int thread_number,
237 const std::string& thread_name_prefix); 237 const std::string& thread_name_prefix);
238 virtual ~Worker(); 238 virtual ~Worker();
239 239
240 // SimpleThread implementation. This actually runs the background thread. 240 // SimpleThread implementation. This actually runs the background thread.
241 virtual void Run() OVERRIDE; 241 virtual void Run() override;
242 242
243 void set_running_task_info(SequenceToken token, 243 void set_running_task_info(SequenceToken token,
244 WorkerShutdown shutdown_behavior) { 244 WorkerShutdown shutdown_behavior) {
245 running_sequence_ = token; 245 running_sequence_ = token;
246 running_shutdown_behavior_ = shutdown_behavior; 246 running_shutdown_behavior_ = shutdown_behavior;
247 } 247 }
248 248
249 SequenceToken running_sequence() const { 249 SequenceToken running_sequence() const {
250 return running_sequence_; 250 return running_sequence_;
251 } 251 }
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { 1285 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) {
1286 DCHECK(constructor_message_loop_->BelongsToCurrentThread()); 1286 DCHECK(constructor_message_loop_->BelongsToCurrentThread());
1287 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); 1287 inner_->Shutdown(max_new_blocking_tasks_after_shutdown);
1288 } 1288 }
1289 1289
1290 bool SequencedWorkerPool::IsShutdownInProgress() { 1290 bool SequencedWorkerPool::IsShutdownInProgress() {
1291 return inner_->IsShutdownInProgress(); 1291 return inner_->IsShutdownInProgress();
1292 } 1292 }
1293 1293
1294 } // namespace base 1294 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/sequenced_worker_pool.h ('k') | base/threading/sequenced_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698