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

Side by Side Diff: base/task_scheduler/task.h

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (Closed)
Patch Set: rebase Created 3 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/scheduler_worker_pool_impl.cc ('k') | base/task_scheduler/task.cc » ('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 #ifndef BASE_TASK_SCHEDULER_TASK_H_ 5 #ifndef BASE_TASK_SCHEDULER_TASK_H_
6 #define BASE_TASK_SCHEDULER_TASK_H_ 6 #define BASE_TASK_SCHEDULER_TASK_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 10 matching lines...) Expand all
21 21
22 // A task is a unit of work inside the task scheduler. Support for tracing and 22 // A task is a unit of work inside the task scheduler. Support for tracing and
23 // profiling inherited from PendingTask. 23 // profiling inherited from PendingTask.
24 struct BASE_EXPORT Task : public PendingTask { 24 struct BASE_EXPORT Task : public PendingTask {
25 // |posted_from| is the site the task was posted from. |task| is the closure 25 // |posted_from| is the site the task was posted from. |task| is the closure
26 // to run. |traits_in| is metadata about the task. |delay| is a delay that 26 // to run. |traits_in| is metadata about the task. |delay| is a delay that
27 // must expire before the Task runs. If |delay| is non-zero and the shutdown 27 // must expire before the Task runs. If |delay| is non-zero and the shutdown
28 // behavior in |traits| is BLOCK_SHUTDOWN, the shutdown behavior is 28 // behavior in |traits| is BLOCK_SHUTDOWN, the shutdown behavior is
29 // automatically adjusted to SKIP_ON_SHUTDOWN. 29 // automatically adjusted to SKIP_ON_SHUTDOWN.
30 Task(const tracked_objects::Location& posted_from, 30 Task(const tracked_objects::Location& posted_from,
31 Closure task, 31 OnceClosure task,
32 const TaskTraits& traits, 32 const TaskTraits& traits,
33 TimeDelta delay); 33 TimeDelta delay);
34 ~Task(); 34 ~Task();
35 35
36 // The TaskTraits of this task. 36 // The TaskTraits of this task.
37 const TaskTraits traits; 37 const TaskTraits traits;
38 38
39 // The delay that must expire before the task runs. 39 // The delay that must expire before the task runs.
40 const TimeDelta delay; 40 const TimeDelta delay;
41 41
(...skipping 18 matching lines...) Expand all
60 private: 60 private:
61 // Disallow copies to make sure no unnecessary ref-bumps are incurred. Making 61 // Disallow copies to make sure no unnecessary ref-bumps are incurred. Making
62 // it move-only would be an option, but isn't necessary for now. 62 // it move-only would be an option, but isn't necessary for now.
63 DISALLOW_COPY_AND_ASSIGN(Task); 63 DISALLOW_COPY_AND_ASSIGN(Task);
64 }; 64 };
65 65
66 } // namespace internal 66 } // namespace internal
67 } // namespace base 67 } // namespace base
68 68
69 #endif // BASE_TASK_SCHEDULER_TASK_H_ 69 #endif // BASE_TASK_SCHEDULER_TASK_H_
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_worker_pool_impl.cc ('k') | base/task_scheduler/task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698