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

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

Issue 2785943004: DCHECK tasks posted by TaskRunner::PostTask (Closed)
Patch Set: fix Created 3 years, 8 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
« no previous file with comments | « base/task_scheduler/sequence_unittest.cc ('k') | base/threading/worker_pool_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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
OLDNEW
« no previous file with comments | « base/task_scheduler/sequence_unittest.cc ('k') | base/threading/worker_pool_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698