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 #include "base/threading/sequenced_worker_pool.h" | 5 #include "base/threading/sequenced_worker_pool.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 return SequenceToken(LockedGetNamedTokenID(name)); | 688 return SequenceToken(LockedGetNamedTokenID(name)); |
689 } | 689 } |
690 | 690 |
691 bool SequencedWorkerPool::Inner::PostTask( | 691 bool SequencedWorkerPool::Inner::PostTask( |
692 const std::string* optional_token_name, | 692 const std::string* optional_token_name, |
693 SequenceToken sequence_token, | 693 SequenceToken sequence_token, |
694 WorkerShutdown shutdown_behavior, | 694 WorkerShutdown shutdown_behavior, |
695 const tracked_objects::Location& from_here, | 695 const tracked_objects::Location& from_here, |
696 Closure task, | 696 Closure task, |
697 TimeDelta delay) { | 697 TimeDelta delay) { |
| 698 DCHECK(task); |
| 699 |
698 // TODO(fdoray): Uncomment this DCHECK. It is initially commented to avoid a | 700 // TODO(fdoray): Uncomment this DCHECK. It is initially commented to avoid a |
699 // revert of the CL that adds debug::DumpWithoutCrashing() if it fails on the | 701 // revert of the CL that adds debug::DumpWithoutCrashing() if it fails on the |
700 // waterfall. https://crbug.com/622400 | 702 // waterfall. https://crbug.com/622400 |
701 // DCHECK_NE(AllPoolsState::POST_TASK_DISABLED, g_all_pools_state); | 703 // DCHECK_NE(AllPoolsState::POST_TASK_DISABLED, g_all_pools_state); |
702 if (g_all_pools_state == AllPoolsState::POST_TASK_DISABLED) | 704 if (g_all_pools_state == AllPoolsState::POST_TASK_DISABLED) |
703 debug::DumpWithoutCrashing(); | 705 debug::DumpWithoutCrashing(); |
704 | 706 |
705 DCHECK(delay.is_zero() || shutdown_behavior == SKIP_ON_SHUTDOWN); | 707 DCHECK(delay.is_zero() || shutdown_behavior == SKIP_ON_SHUTDOWN); |
706 SequencedTask sequenced(from_here); | 708 SequencedTask sequenced(from_here); |
707 sequenced.sequence_token_id = sequence_token.id_; | 709 sequenced.sequence_token_id = sequence_token.id_; |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 bool SequencedWorkerPool::IsShutdownInProgress() { | 1629 bool SequencedWorkerPool::IsShutdownInProgress() { |
1628 return inner_->IsShutdownInProgress(); | 1630 return inner_->IsShutdownInProgress(); |
1629 } | 1631 } |
1630 | 1632 |
1631 bool SequencedWorkerPool::IsRunningSequenceOnCurrentThread( | 1633 bool SequencedWorkerPool::IsRunningSequenceOnCurrentThread( |
1632 SequenceToken sequence_token) const { | 1634 SequenceToken sequence_token) const { |
1633 return inner_->IsRunningSequenceOnCurrentThread(sequence_token); | 1635 return inner_->IsRunningSequenceOnCurrentThread(sequence_token); |
1634 } | 1636 } |
1635 | 1637 |
1636 } // namespace base | 1638 } // namespace base |
OLD | NEW |