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

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: fix compile (why did this compile locally?! 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 25 matching lines...) Expand all
57 virtual void PostTaskWithSequenceNow( 57 virtual void PostTaskWithSequenceNow(
58 std::unique_ptr<Task> task, 58 std::unique_ptr<Task> task,
59 scoped_refptr<Sequence> sequence, 59 scoped_refptr<Sequence> sequence,
60 SchedulerWorkerThread* worker_thread) = 0; 60 SchedulerWorkerThread* worker_thread) = 0;
61 }; 61 };
62 62
63 } // namespace internal 63 } // namespace internal
64 } // namespace base 64 } // namespace base
65 65
66 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_ 66 #endif // BASE_TASK_SCHEDULER_SCHEDULER_THREAD_POOL_H_
OLDNEW
« no previous file with comments | « base/task_scheduler/priority_queue_unittest.cc ('k') | base/task_scheduler/scheduler_thread_pool_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698