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

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

Issue 1708773002: TaskScheduler [7] SchedulerThreadPool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s_5_worker_thread
Patch Set: fix windows build error Created 4 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 unified diff | Download patch
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | base/task_scheduler/utils.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 <ostream> 7 #include <ostream>
8 8
9 namespace base { 9 namespace base {
10 10
(...skipping 16 matching lines...) Expand all
27 priority_ = priority; 27 priority_ = priority;
28 return *this; 28 return *this;
29 } 29 }
30 30
31 TaskTraits& TaskTraits::WithShutdownBehavior( 31 TaskTraits& TaskTraits::WithShutdownBehavior(
32 TaskShutdownBehavior shutdown_behavior) { 32 TaskShutdownBehavior shutdown_behavior) {
33 shutdown_behavior_ = shutdown_behavior; 33 shutdown_behavior_ = shutdown_behavior;
34 return *this; 34 return *this;
35 } 35 }
36 36
37 bool TaskTraits::operator==(const TaskTraits& other) const {
38 return with_file_io_ == other.with_file_io_ && priority_ == other.priority_ &&
39 shutdown_behavior_ == other.shutdown_behavior_;
40 }
41
37 std::ostream& operator<<(std::ostream& os, const TaskPriority& task_priority) { 42 std::ostream& operator<<(std::ostream& os, const TaskPriority& task_priority) {
38 switch (task_priority) { 43 switch (task_priority) {
39 case TaskPriority::BACKGROUND: 44 case TaskPriority::BACKGROUND:
40 os << "BACKGROUND"; 45 os << "BACKGROUND";
41 break; 46 break;
42 case TaskPriority::USER_VISIBLE: 47 case TaskPriority::USER_VISIBLE:
43 os << "USER_VISIBLE"; 48 os << "USER_VISIBLE";
44 break; 49 break;
45 case TaskPriority::USER_BLOCKING: 50 case TaskPriority::USER_BLOCKING:
46 os << "USER_BLOCKING"; 51 os << "USER_BLOCKING";
(...skipping 12 matching lines...) Expand all
59 os << "SKIP_ON_SHUTDOWN"; 64 os << "SKIP_ON_SHUTDOWN";
60 break; 65 break;
61 case TaskShutdownBehavior::BLOCK_SHUTDOWN: 66 case TaskShutdownBehavior::BLOCK_SHUTDOWN:
62 os << "BLOCK_SHUTDOWN"; 67 os << "BLOCK_SHUTDOWN";
63 break; 68 break;
64 } 69 }
65 return os; 70 return os;
66 } 71 }
67 72
68 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | base/task_scheduler/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698