OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/task_scheduler/task_traits.h" | 5 #include "base/task_scheduler/task_traits.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <ostream> | 9 #include <ostream> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 return "CONTINUE_ON_SHUTDOWN"; | 58 return "CONTINUE_ON_SHUTDOWN"; |
59 case TaskShutdownBehavior::SKIP_ON_SHUTDOWN: | 59 case TaskShutdownBehavior::SKIP_ON_SHUTDOWN: |
60 return "SKIP_ON_SHUTDOWN"; | 60 return "SKIP_ON_SHUTDOWN"; |
61 case TaskShutdownBehavior::BLOCK_SHUTDOWN: | 61 case TaskShutdownBehavior::BLOCK_SHUTDOWN: |
62 return "BLOCK_SHUTDOWN"; | 62 return "BLOCK_SHUTDOWN"; |
63 } | 63 } |
64 NOTREACHED(); | 64 NOTREACHED(); |
65 return ""; | 65 return ""; |
66 } | 66 } |
67 | 67 |
68 const char* ExecutionModeToString(ExecutionMode execution_mode) { | |
69 switch (execution_mode) { | |
70 case ExecutionMode::PARALLEL: | |
71 return "PARALLEL"; | |
72 case ExecutionMode::SEQUENCED: | |
73 return "SEQUENCED"; | |
74 case ExecutionMode::SINGLE_THREADED: | |
75 return "SINGLE_THREADED"; | |
76 } | |
77 NOTREACHED(); | |
78 return ""; | |
79 } | |
80 | |
81 std::ostream& operator<<(std::ostream& os, const TaskPriority& task_priority) { | 68 std::ostream& operator<<(std::ostream& os, const TaskPriority& task_priority) { |
82 os << TaskPriorityToString(task_priority); | 69 os << TaskPriorityToString(task_priority); |
83 return os; | 70 return os; |
84 } | 71 } |
85 | 72 |
86 std::ostream& operator<<(std::ostream& os, | 73 std::ostream& operator<<(std::ostream& os, |
87 const TaskShutdownBehavior& shutdown_behavior) { | 74 const TaskShutdownBehavior& shutdown_behavior) { |
88 os << TaskShutdownBehaviorToString(shutdown_behavior); | 75 os << TaskShutdownBehaviorToString(shutdown_behavior); |
89 return os; | 76 return os; |
90 } | 77 } |
91 | 78 |
92 std::ostream& operator<<(std::ostream& os, | |
93 const ExecutionMode& execution_mode) { | |
94 os << ExecutionModeToString(execution_mode); | |
95 return os; | |
96 } | |
97 | |
98 } // namespace base | 79 } // namespace base |
OLD | NEW |