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

Unified Diff: base/task_scheduler/task.cc

Issue 2831883003: Do not inherit TaskPriority in TaskTraits. (Closed)
Patch Set: self-review 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
Index: base/task_scheduler/task.cc
diff --git a/base/task_scheduler/task.cc b/base/task_scheduler/task.cc
index fc513e3e9fb53945bc22b21185430457e9e382ea..9bd99789cc34a7af2143907c17387b9720a68432 100644
--- a/base/task_scheduler/task.cc
+++ b/base/task_scheduler/task.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/critical_closure.h"
+#include "base/logging.h"
namespace base {
namespace internal {
@@ -29,7 +30,10 @@ Task::Task(const tracked_objects::Location& posted_from,
? TaskTraits(traits).WithShutdownBehavior(
TaskShutdownBehavior::SKIP_ON_SHUTDOWN)
: traits),
- delay(delay) {}
+ delay(delay) {
+ DCHECK_LE(static_cast<int>(traits.priority()),
+ static_cast<int>(TaskPriority::HIGHEST));
+}
Task::~Task() = default;

Powered by Google App Engine
This is Rietveld 408576698