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

Unified Diff: base/task_scheduler/task_tracker.cc

Issue 2557083002: Run ScopedTaskScheduler tasks synchronously. (Closed)
Patch Set: CR robliao #27 Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: base/task_scheduler/task_tracker.cc
diff --git a/base/task_scheduler/task_tracker.cc b/base/task_scheduler/task_tracker.cc
index 4c1ee8da3dd285ea1f668cab15b4f4565e91059e..447b35a9f3dfa72e550f238654d97452b05a4284 100644
--- a/base/task_scheduler/task_tracker.cc
+++ b/base/task_scheduler/task_tracker.cc
@@ -288,6 +288,14 @@ bool TaskTracker::IsShutdownComplete() const {
}
void TaskTracker::SetHasShutdownStartedForTesting() {
+ AutoSchedulerLock auto_lock(shutdown_lock_);
+
+ // Create a dummy |shutdown_event_| to satisfy TaskTracker's expectation of
+ // its existence during shutdown (e.g. in OnBlockingShutdownTasksComplete()).
+ shutdown_event_.reset(
+ new WaitableEvent(WaitableEvent::ResetPolicy::MANUAL,
+ WaitableEvent::InitialState::NOT_SIGNALED));
+
state_->StartShutdown();
}

Powered by Google App Engine
This is Rietveld 408576698