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

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

Issue 614103004: replace 'virtual ... OVERRIDE' with '... override' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: process 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // fixed ShutdownBehavior. 91 // fixed ShutdownBehavior.
92 // 92 //
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 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 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 29 matching lines...) Expand all
144 // 144 //
145 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner). 145 // Note that this class is RefCountedThreadSafe (inherited from TaskRunner).
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 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 bool RunsTasksOnCurrentThread() const override;
158 158
159 // SequencedTaskRunner implementation 159 // SequencedTaskRunner implementation
160 virtual bool PostNonNestableDelayedTask( 160 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
161 const tracked_objects::Location& from_here, 161 const Closure& task,
162 const Closure& task, 162 TimeDelta delay) override;
163 TimeDelta delay) OVERRIDE;
164 163
165 private: 164 private:
166 virtual ~SequencedWorkerPoolSequencedTaskRunner(); 165 virtual ~SequencedWorkerPoolSequencedTaskRunner();
167 166
168 const scoped_refptr<SequencedWorkerPool> pool_; 167 const scoped_refptr<SequencedWorkerPool> pool_;
169 168
170 const SequencedWorkerPool::SequenceToken token_; 169 const SequencedWorkerPool::SequenceToken token_;
171 170
172 const SequencedWorkerPool::WorkerShutdown shutdown_behavior_; 171 const SequencedWorkerPool::WorkerShutdown shutdown_behavior_;
173 172
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 class SequencedWorkerPool::Worker : public SimpleThread { 230 class SequencedWorkerPool::Worker : public SimpleThread {
232 public: 231 public:
233 // Hold a (cyclic) ref to |worker_pool|, since we want to keep it 232 // Hold a (cyclic) ref to |worker_pool|, since we want to keep it
234 // around as long as we are running. 233 // around as long as we are running.
235 Worker(const scoped_refptr<SequencedWorkerPool>& worker_pool, 234 Worker(const scoped_refptr<SequencedWorkerPool>& worker_pool,
236 int thread_number, 235 int thread_number,
237 const std::string& thread_name_prefix); 236 const std::string& thread_name_prefix);
238 virtual ~Worker(); 237 virtual ~Worker();
239 238
240 // SimpleThread implementation. This actually runs the background thread. 239 // SimpleThread implementation. This actually runs the background thread.
241 virtual void Run() OVERRIDE; 240 void Run() override;
242 241
243 void set_running_task_info(SequenceToken token, 242 void set_running_task_info(SequenceToken token,
244 WorkerShutdown shutdown_behavior) { 243 WorkerShutdown shutdown_behavior) {
245 running_sequence_ = token; 244 running_sequence_ = token;
246 running_shutdown_behavior_ = shutdown_behavior; 245 running_shutdown_behavior_ = shutdown_behavior;
247 } 246 }
248 247
249 SequenceToken running_sequence() const { 248 SequenceToken running_sequence() const {
250 return running_sequence_; 249 return running_sequence_;
251 } 250 }
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { 1284 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) {
1286 DCHECK(constructor_message_loop_->BelongsToCurrentThread()); 1285 DCHECK(constructor_message_loop_->BelongsToCurrentThread());
1287 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); 1286 inner_->Shutdown(max_new_blocking_tasks_after_shutdown);
1288 } 1287 }
1289 1288
1290 bool SequencedWorkerPool::IsShutdownInProgress() { 1289 bool SequencedWorkerPool::IsShutdownInProgress() {
1291 return inner_->IsShutdownInProgress(); 1290 return inner_->IsShutdownInProgress();
1292 } 1291 }
1293 1292
1294 } // namespace base 1293 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698