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

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

Issue 1903133003: TaskScheduler: Avoid Sequence refcount bump in GetWork() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review:robliao/fdoray#14-15 Created 4 years, 7 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
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_THREAD_POOL_H_ 5 #ifndef BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_
6 #define BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ 6 #define BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/task_runner.h" 12 #include "base/task_runner.h"
13 #include "base/task_scheduler/sequence.h" 13 #include "base/task_scheduler/sequence.h"
14 #include "base/task_scheduler/task.h" 14 #include "base/task_scheduler/task.h"
15 #include "base/task_scheduler/task_traits.h" 15 #include "base/task_scheduler/task_traits.h"
16 16
17 namespace base { 17 namespace base {
18 namespace internal { 18 namespace internal {
19 19
20 class SchedulerWorkerThread; 20 class SchedulerWorkerThread;
21 struct SequenceSortKey; 21 class SequenceSortKey;
22 22
23 // Interface for a thread pool. 23 // Interface for a thread pool.
24 class BASE_EXPORT SchedulerThreadPool { 24 class BASE_EXPORT SchedulerThreadPool {
25 public: 25 public:
26 virtual ~SchedulerThreadPool() = default; 26 virtual ~SchedulerThreadPool() = default;
27 27
28 // Returns a TaskRunner whose PostTask invocations will result in scheduling 28 // Returns a TaskRunner whose PostTask invocations will result in scheduling
29 // Tasks with |traits| and |execution_mode| in this thread pool. 29 // Tasks with |traits| and |execution_mode| in this thread pool.
30 virtual scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( 30 virtual scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(
31 const TaskTraits& traits, 31 const TaskTraits& traits,
(...skipping 21 matching lines...) Expand all
53 virtual void PostTaskWithSequenceNow( 53 virtual void PostTaskWithSequenceNow(
54 std::unique_ptr<Task> task, 54 std::unique_ptr<Task> task,
55 scoped_refptr<Sequence> sequence, 55 scoped_refptr<Sequence> sequence,
56 SchedulerWorkerThread* worker_thread) = 0; 56 SchedulerWorkerThread* worker_thread) = 0;
57 }; 57 };
58 58
59 } // namespace internal 59 } // namespace internal
60 } // namespace base 60 } // namespace base
61 61
62 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ 62 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698