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

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

Issue 2611753004: Change const TimeDelta& to TimeDelta in base/task_scheduler/. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | base/task_scheduler/scheduler_worker_pool_impl.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 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_WORKER_H_ 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_WORKER_H_
6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_H_ 6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 virtual void OnMainEntry(SchedulerWorker* worker) = 0; 50 virtual void OnMainEntry(SchedulerWorker* worker) = 0;
51 51
52 // Called by a thread managed by |worker| to get a Sequence from which to 52 // Called by a thread managed by |worker| to get a Sequence from which to
53 // run a Task. 53 // run a Task.
54 virtual scoped_refptr<Sequence> GetWork(SchedulerWorker* worker) = 0; 54 virtual scoped_refptr<Sequence> GetWork(SchedulerWorker* worker) = 0;
55 55
56 // Called by the SchedulerWorker after it ran a task with |task_priority|. 56 // Called by the SchedulerWorker after it ran a task with |task_priority|.
57 // |task_latency| is the time elapsed between when the task was posted and 57 // |task_latency| is the time elapsed between when the task was posted and
58 // when it started to run. 58 // when it started to run.
59 virtual void DidRunTaskWithPriority(TaskPriority task_priority, 59 virtual void DidRunTaskWithPriority(TaskPriority task_priority,
60 const TimeDelta& task_latency) = 0; 60 TimeDelta task_latency) = 0;
61 61
62 // Called when |sequence| isn't empty after the SchedulerWorker pops a Task 62 // Called when |sequence| isn't empty after the SchedulerWorker pops a Task
63 // from it. |sequence| is the last Sequence returned by GetWork(). 63 // from it. |sequence| is the last Sequence returned by GetWork().
64 virtual void ReEnqueueSequence(scoped_refptr<Sequence> sequence) = 0; 64 virtual void ReEnqueueSequence(scoped_refptr<Sequence> sequence) = 0;
65 65
66 // Called by a thread to determine how long to sleep before the next call to 66 // Called by a thread to determine how long to sleep before the next call to
67 // GetWork(). GetWork() may be called before this timeout expires if the 67 // GetWork(). GetWork() may be called before this timeout expires if the
68 // worker's WakeUp() method is called. 68 // worker's WakeUp() method is called.
69 virtual TimeDelta GetSleepTimeout() = 0; 69 virtual TimeDelta GetSleepTimeout() = 0;
70 70
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // Set once JoinForTesting() has been called. 154 // Set once JoinForTesting() has been called.
155 AtomicFlag should_exit_for_testing_; 155 AtomicFlag should_exit_for_testing_;
156 156
157 DISALLOW_COPY_AND_ASSIGN(SchedulerWorker); 157 DISALLOW_COPY_AND_ASSIGN(SchedulerWorker);
158 }; 158 };
159 159
160 } // namespace internal 160 } // namespace internal
161 } // namespace base 161 } // namespace base
162 162
163 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_H_ 163 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_H_
OLDNEW
« no previous file with comments | « no previous file | base/task_scheduler/scheduler_worker_pool_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698