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

Unified Diff: base/task_scheduler/task_traits.h

Issue 2831883003: Do not inherit TaskPriority in TaskTraits. (Closed)
Patch Set: CR-gab-9 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_traits.h
diff --git a/base/task_scheduler/task_traits.h b/base/task_scheduler/task_traits.h
index 435fdac9af3843d18cec36bd441dacb6e74f91cf..61a1d548fd442015d9835afde00b0d2ef4eb8c8f 100644
--- a/base/task_scheduler/task_traits.h
+++ b/base/task_scheduler/task_traits.h
@@ -142,6 +142,9 @@ class BASE_EXPORT TaskTraits {
// Returns true if tasks with these traits may use base/ sync primitives.
bool with_base_sync_primitives() const { return with_base_sync_primitives_; }
+ // Returns true if the priority was set explicitly.
+ bool priority_set_explicitly() const { return priority_set_explicitly_; }
+
// Returns the priority of tasks with these traits.
TaskPriority priority() const { return priority_; }
@@ -149,8 +152,9 @@ class BASE_EXPORT TaskTraits {
TaskShutdownBehavior shutdown_behavior() const { return shutdown_behavior_; }
private:
- bool may_block_;
- bool with_base_sync_primitives_;
+ bool may_block_ : 1;
+ bool with_base_sync_primitives_ : 1;
+ bool priority_set_explicitly_ : 1;
gab 2017/04/25 17:16:41 Let's ask Etienne to make sure these bit optimizat
etienneb 2017/04/25 17:45:59 Using bool x : 1; bool y : 1; This will use less
fdoray 2017/04/25 17:57:48 Since there will be very few accesses (ignoring co
etienneb 2017/04/25 18:05:47 If this is not "largely" used, I'll stay with the
fdoray 2017/04/25 18:40:25 Done.
TaskPriority priority_;
TaskShutdownBehavior shutdown_behavior_;
};

Powered by Google App Engine
This is Rietveld 408576698