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

Unified Diff: base/task_scheduler/task_traits.cc

Issue 2831883003: Do not inherit TaskPriority in TaskTraits. (Closed)
Patch Set: CR-gab-34 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | base/task_scheduler/task_traits_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_traits.cc
diff --git a/base/task_scheduler/task_traits.cc b/base/task_scheduler/task_traits.cc
index 6acf3244f59e475c51ee21a1741ba94259fbfdf3..c00ae6c48cd1d60e1326a5e507df6e99d8c2cf26 100644
--- a/base/task_scheduler/task_traits.cc
+++ b/base/task_scheduler/task_traits.cc
@@ -9,19 +9,10 @@
#include <ostream>
#include "base/logging.h"
-#include "base/task_scheduler/scoped_set_task_priority_for_current_thread.h"
namespace base {
-// Do not rely on defaults hard-coded below beyond the guarantees described in
-// the header; anything else is subject to change. Tasks should explicitly
-// request defaults if the behavior is critical to the task.
-TaskTraits::TaskTraits()
- : may_block_(false),
- with_base_sync_primitives_(false),
- priority_(internal::GetTaskPriorityForCurrentThread()),
- shutdown_behavior_(TaskShutdownBehavior::SKIP_ON_SHUTDOWN) {}
-
+TaskTraits::TaskTraits() = default;
TaskTraits::~TaskTraits() = default;
TaskTraits& TaskTraits::MayBlock() {
@@ -35,6 +26,7 @@ TaskTraits& TaskTraits::WithBaseSyncPrimitives() {
}
TaskTraits& TaskTraits::WithPriority(TaskPriority priority) {
+ priority_set_explicitly_ = true;
priority_ = priority;
return *this;
}
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | base/task_scheduler/task_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698