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

Unified Diff: base/task_scheduler/task_tracker.cc

Issue 2531663003: TaskScheduler: Add TaskTraits::WithWait(). (Closed)
Patch Set: CR robliao #9 (wording, order of ThreadRestrictions reset) Created 4 years, 1 month 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 49a33be8c24b113f82c0ab0a1ad1047465aee2bb..2ab4a4eff277c35e6fc2c86f8d59c25e920cb2fa 100644
--- a/base/task_scheduler/task_tracker.cc
+++ b/base/task_scheduler/task_tracker.cc
@@ -225,6 +225,8 @@ bool TaskTracker::RunTask(std::unique_ptr<Task> task,
TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN);
const bool previous_io_allowed =
ThreadRestrictions::SetIOAllowed(task->traits.with_file_io());
+ const bool previous_wait_allowed =
+ ThreadRestrictions::SetWaitAllowed(task->traits.with_wait());
{
// Set up SequenceToken as expected for the scope of the task.
@@ -261,8 +263,9 @@ bool TaskTracker::RunTask(std::unique_ptr<Task> task,
PerformRunTask(std::move(task));
}
- ThreadRestrictions::SetSingletonAllowed(previous_singleton_allowed);
+ ThreadRestrictions::SetWaitAllowed(previous_wait_allowed);
ThreadRestrictions::SetIOAllowed(previous_io_allowed);
+ ThreadRestrictions::SetSingletonAllowed(previous_singleton_allowed);
AfterRunTask(shutdown_behavior);
}

Powered by Google App Engine
This is Rietveld 408576698