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 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <cstddef> | 10 #include <cstddef> |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 bool PostSequencedWorkerTaskWithShutdownBehavior( | 338 bool PostSequencedWorkerTaskWithShutdownBehavior( |
339 SequenceToken sequence_token, | 339 SequenceToken sequence_token, |
340 const tracked_objects::Location& from_here, | 340 const tracked_objects::Location& from_here, |
341 OnceClosure task, | 341 OnceClosure task, |
342 WorkerShutdown shutdown_behavior); | 342 WorkerShutdown shutdown_behavior); |
343 | 343 |
344 // TaskRunner implementation. Forwards to PostDelayedWorkerTask(). | 344 // TaskRunner implementation. Forwards to PostDelayedWorkerTask(). |
345 bool PostDelayedTask(const tracked_objects::Location& from_here, | 345 bool PostDelayedTask(const tracked_objects::Location& from_here, |
346 OnceClosure task, | 346 OnceClosure task, |
347 TimeDelta delay) override; | 347 TimeDelta delay) override; |
348 bool RunsTasksOnCurrentThread() const override; | 348 bool RunsTasksInCurrentSequence() const override; |
349 | 349 |
350 // Blocks until all pending tasks are complete. This should only be called in | 350 // Blocks until all pending tasks are complete. This should only be called in |
351 // unit tests when you want to validate something that should have happened. | 351 // unit tests when you want to validate something that should have happened. |
352 // Does not wait for delayed tasks. If redirection to TaskScheduler is | 352 // Does not wait for delayed tasks. If redirection to TaskScheduler is |
353 // disabled, delayed tasks are deleted. If redirection to TaskScheduler is | 353 // disabled, delayed tasks are deleted. If redirection to TaskScheduler is |
354 // enabled, this will wait for all tasks posted to TaskScheduler (not just | 354 // enabled, this will wait for all tasks posted to TaskScheduler (not just |
355 // tasks posted to this SequencedWorkerPool). | 355 // tasks posted to this SequencedWorkerPool). |
356 // | 356 // |
357 // Note that calling this will not prevent other threads from posting work to | 357 // Note that calling this will not prevent other threads from posting work to |
358 // the queue while the calling thread is waiting on Flush(). In this case, | 358 // the queue while the calling thread is waiting on Flush(). In this case, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // Avoid pulling in too many headers by putting (almost) everything | 409 // Avoid pulling in too many headers by putting (almost) everything |
410 // into |inner_|. | 410 // into |inner_|. |
411 const std::unique_ptr<Inner> inner_; | 411 const std::unique_ptr<Inner> inner_; |
412 | 412 |
413 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPool); | 413 DISALLOW_COPY_AND_ASSIGN(SequencedWorkerPool); |
414 }; | 414 }; |
415 | 415 |
416 } // namespace base | 416 } // namespace base |
417 | 417 |
418 #endif // BASE_THREADING_SEQUENCED_WORKER_POOL_H_ | 418 #endif // BASE_THREADING_SEQUENCED_WORKER_POOL_H_ |
OLD | NEW |