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

Side by Side Diff: base/task_scheduler/task_traits.cc

Issue 2464963002: TaskScheduler: Remove base::ExecutionMode. (Closed)
Patch Set: CR danakj #17 Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | base/task_scheduler/test_task_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | base/task_scheduler/test_task_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698