OLD | NEW |
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 #ifndef BASE_THREADING_SEQUENCED_WORKER_POOL_H_ | 5 #ifndef BASE_THREADING_SEQUENCED_WORKER_POOL_H_ |
6 #define BASE_THREADING_SEQUENCED_WORKER_POOL_H_ | 6 #define BASE_THREADING_SEQUENCED_WORKER_POOL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <string> | 10 #include <string> |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // behavior. | 224 // behavior. |
225 bool PostSequencedWorkerTaskWithShutdownBehavior( | 225 bool PostSequencedWorkerTaskWithShutdownBehavior( |
226 SequenceToken sequence_token, | 226 SequenceToken sequence_token, |
227 const tracked_objects::Location& from_here, | 227 const tracked_objects::Location& from_here, |
228 const Closure& task, | 228 const Closure& task, |
229 WorkerShutdown shutdown_behavior); | 229 WorkerShutdown shutdown_behavior); |
230 | 230 |
231 // TaskRunner implementation. Forwards to PostWorkerTask(). | 231 // TaskRunner implementation. Forwards to PostWorkerTask(). |
232 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | 232 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
233 const Closure& task, | 233 const Closure& task, |
| 234 int64 delay_ms) OVERRIDE; |
| 235 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 236 const Closure& task, |
234 TimeDelta delay) OVERRIDE; | 237 TimeDelta delay) OVERRIDE; |
235 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; | 238 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; |
236 | 239 |
237 // Returns true if the current thread is processing a task with the given | 240 // Returns true if the current thread is processing a task with the given |
238 // sequence_token. | 241 // sequence_token. |
239 bool IsRunningSequenceOnCurrentThread(SequenceToken sequence_token) const; | 242 bool IsRunningSequenceOnCurrentThread(SequenceToken sequence_token) const; |
240 | 243 |
241 // Blocks until all pending tasks are complete. This should only be called in | 244 // Blocks until all pending tasks are complete. This should only be called in |
242 // unit tests when you want to validate something that should have happened. | 245 // unit tests when you want to validate something that should have happened. |
243 // | 246 // |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Avoid pulling in too many headers by putting (almost) everything | 278 // Avoid pulling in too many headers by putting (almost) everything |
276 // into |inner_|. | 279 // into |inner_|. |
277 const scoped_ptr<Inner> inner_; | 280 const scoped_ptr<Inner> inner_; |
278 | 281 |
279 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPool); | 282 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPool); |
280 }; | 283 }; |
281 | 284 |
282 } // namespace base | 285 } // namespace base |
283 | 286 |
284 #endif // BASE_THREADING_SEQUENCED_WORKER_POOL_H_ | 287 #endif // BASE_THREADING_SEQUENCED_WORKER_POOL_H_ |
OLD | NEW |