Chromium Code Reviews| Index: base/task_scheduler/task_tracker.cc |
| diff --git a/base/task_scheduler/task_tracker.cc b/base/task_scheduler/task_tracker.cc |
| index 8817baa04701088ece63b91005c68fe19ddca6e3..4c0b3f3edc4d94dc5f34c4a51b7f10622a82cb37 100644 |
| --- a/base/task_scheduler/task_tracker.cc |
| +++ b/base/task_scheduler/task_tracker.cc |
| @@ -219,11 +219,19 @@ bool TaskTracker::IsShutdownComplete() const { |
| return shutdown_event_ && shutdown_event_->IsSignaled(); |
| } |
| -bool TaskTracker::IsShuttingDownForTesting() const { |
| +bool TaskTracker::IsShutdownInProgress() const { |
| AutoSchedulerLock auto_lock(shutdown_lock_); |
| return shutdown_event_ && !shutdown_event_->IsSignaled(); |
| } |
| +void TaskTracker::SetIsShutdownInProgressForTesting() { |
| + AutoSchedulerLock auto_lock(shutdown_lock_); |
| + DCHECK(!shutdown_event_); |
| + shutdown_event_.reset( |
| + new WaitableEvent(WaitableEvent::ResetPolicy::MANUAL, |
|
robliao
2016/07/19 22:41:28
Unify this event creation with the one in Shutdown
fdoray
2016/07/20 18:22:21
n/a
|
| + WaitableEvent::InitialState::NOT_SIGNALED)); |
| +} |
| + |
| bool TaskTracker::BeforePostTask(TaskShutdownBehavior shutdown_behavior) { |
| if (shutdown_behavior == TaskShutdownBehavior::BLOCK_SHUTDOWN) { |
| // BLOCK_SHUTDOWN tasks block shutdown between the moment they are posted |