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

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

Issue 1702813002: Task Scheduler [1/8] Task Traits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 10 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/task_scheduler/task_traits.h"
6
7 namespace base {
8
9 // Do not rely on defaults hard-coded below beyond the guarantees described in
10 // the header; anything else is subject to change. Tasks should explicitly
11 // request defaults if the behavior is critical to the task.
12 TaskTraits::TaskTraits()
13 : with_file_io_(false),
14 priority_(TaskPriority::BACKGROUND),
15 shutdown_behavior_(TaskShutdownBehavior::BLOCK_SHUTDOWN) {}
16
17 TaskTraits::~TaskTraits() = default;
18
19 TaskTraits& TaskTraits::WithFileIO() {
20 with_file_io_ = true;
21 return *this;
22 }
23
24 TaskTraits& TaskTraits::WithPriority(TaskPriority priority) {
25 priority_ = priority;
26 return *this;
27 }
28
29 TaskTraits& TaskTraits::WithShutdownBehavior(
30 TaskShutdownBehavior shutdown_behavior) {
31 shutdown_behavior_ = shutdown_behavior;
32 return *this;
33 }
34
35 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/task_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698