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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 return SequenceToken(LockedGetNamedTokenID(name)); | 690 return SequenceToken(LockedGetNamedTokenID(name)); |
691 } | 691 } |
692 | 692 |
693 bool SequencedWorkerPool::Inner::PostTask( | 693 bool SequencedWorkerPool::Inner::PostTask( |
694 const std::string* optional_token_name, | 694 const std::string* optional_token_name, |
695 SequenceToken sequence_token, | 695 SequenceToken sequence_token, |
696 WorkerShutdown shutdown_behavior, | 696 WorkerShutdown shutdown_behavior, |
697 const tracked_objects::Location& from_here, | 697 const tracked_objects::Location& from_here, |
698 OnceClosure task, | 698 OnceClosure task, |
699 TimeDelta delay) { | 699 TimeDelta delay) { |
700 DCHECK(task); | 700 // Use CHECK instead of DCHECK to crash earlier. See http://crbug.com/711167 |
| 701 // for details. |
| 702 CHECK(task); |
701 | 703 |
702 // TODO(fdoray): Uncomment this DCHECK. It is initially commented to avoid a | 704 // TODO(fdoray): Uncomment this DCHECK. It is initially commented to avoid a |
703 // revert of the CL that adds debug::DumpWithoutCrashing() if it fails on the | 705 // revert of the CL that adds debug::DumpWithoutCrashing() if it fails on the |
704 // waterfall. https://crbug.com/622400 | 706 // waterfall. https://crbug.com/622400 |
705 // DCHECK_NE(AllPoolsState::POST_TASK_DISABLED, g_all_pools_state); | 707 // DCHECK_NE(AllPoolsState::POST_TASK_DISABLED, g_all_pools_state); |
706 if (g_all_pools_state == AllPoolsState::POST_TASK_DISABLED) | 708 if (g_all_pools_state == AllPoolsState::POST_TASK_DISABLED) |
707 debug::DumpWithoutCrashing(); | 709 debug::DumpWithoutCrashing(); |
708 | 710 |
709 DCHECK(delay.is_zero() || shutdown_behavior == SKIP_ON_SHUTDOWN); | 711 DCHECK(delay.is_zero() || shutdown_behavior == SKIP_ON_SHUTDOWN); |
710 SequencedTask sequenced(from_here); | 712 SequencedTask sequenced(from_here); |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 bool SequencedWorkerPool::IsShutdownInProgress() { | 1644 bool SequencedWorkerPool::IsShutdownInProgress() { |
1643 return inner_->IsShutdownInProgress(); | 1645 return inner_->IsShutdownInProgress(); |
1644 } | 1646 } |
1645 | 1647 |
1646 bool SequencedWorkerPool::IsRunningSequenceOnCurrentThread( | 1648 bool SequencedWorkerPool::IsRunningSequenceOnCurrentThread( |
1647 SequenceToken sequence_token) const { | 1649 SequenceToken sequence_token) const { |
1648 return inner_->IsRunningSequenceOnCurrentThread(sequence_token); | 1650 return inner_->IsRunningSequenceOnCurrentThread(sequence_token); |
1649 } | 1651 } |
1650 | 1652 |
1651 } // namespace base | 1653 } // namespace base |
OLD | NEW |