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

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

Issue 1864333002: TaskScheduler: Delegate instead of callbacks for SchedulerWorkerThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_WORKER_THREAD_DELEGATE_H_
6 #define BASE_TASK_SCHEDULER_SCHEDULER_WORKER_THREAD_DELEGATE_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/task_scheduler/sequence.h"
10
11 namespace base {
12 namespace internal {
13
14 class SchedulerWorkerThread;
robliao 2016/04/06 20:50:18 Remove forward declaration.
fdoray 2016/04/06 21:11:38 Done.
15
16 // Delegate interface for SchedulerWorkerThread. The methods are always called
17 // from the thread managed by the SchedulerWorkerThread instance.
18 class SchedulerWorkerThreadDelegate {
19 public:
20 // Called when the main function of the SchedulerWorkerThread is entered.
21 virtual void OnMainEntry() = 0;
22
23 // Called when the main function of the SchedulerWorkerThread exits.
24 virtual void OnMainExit() = 0;
25
26 // Called by the SchedulerWorkerThread to get a Sequence from which to run a
27 // Task.
28 virtual scoped_refptr<Sequence> GetWork() = 0;
29
30 // Called after the SchedulerWorkerThread has tried to run a Task from
31 // |sequence| (a TaskTracker might have prevented the Task from running).
32 virtual void RanTaskFromSequence(scoped_refptr<Sequence> sequence) = 0;
33 };
34
35 } // namespace internal
36 } // namespace base
37
38 #endif // BASE_TASK_SCHEDULER_SCHEDULER_WORKER_THREAD_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698