Chromium Code Reviews| Index: base/task_scheduler/task_traits.cc |
| diff --git a/base/task_scheduler/task_traits.cc b/base/task_scheduler/task_traits.cc |
| index be77ba9d278a78b2eb1780f7f380f8c05078e7d6..9e5be327383c20b760b7034e9240c3656dae64e3 100644 |
| --- a/base/task_scheduler/task_traits.cc |
| +++ b/base/task_scheduler/task_traits.cc |
| @@ -4,6 +4,8 @@ |
| #include "base/task_scheduler/task_traits.h" |
| +#include <ostream> |
| + |
| namespace base { |
| // Do not rely on defaults hard-coded below beyond the guarantees described in |
| @@ -32,4 +34,18 @@ TaskTraits& TaskTraits::WithShutdownBehavior( |
| return *this; |
| } |
| +void PrintTo(const TaskPriority& task_priority, std::ostream* os) { |
|
robliao
2016/02/19 02:33:43
Can this go in a test only utils file?
fdoray
2016/02/19 14:12:15
See comment in task_traits.h
|
| + switch (task_priority) { |
| + case TaskPriority::BACKGROUND: |
| + *os << "BACKGROUND"; |
| + break; |
| + case TaskPriority::USER_VISIBLE: |
| + *os << "USER_VISIBLE"; |
| + break; |
| + case TaskPriority::USER_BLOCKING: |
| + *os << "USER_BLOCKING"; |
| + break; |
|
robliao
2016/02/19 02:33:43
default case: DCHECK(false).
fdoray
2016/02/19 14:12:15
See gab's comment https://codereview.chromium.org/
|
| + } |
| +} |
| + |
| } // namespace base |