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

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

Issue 2726523002: Pass Callback to TaskRunner by value and consume it on invocation (1) (Closed)
Patch Set: s/base::ResetAndReturn/std::move/ Created 3 years, 9 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_TASK_SCHEDULER_IMPL_H_ 5 #ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 30 matching lines...) Expand all
41 static std::unique_ptr<TaskSchedulerImpl> Create( 41 static std::unique_ptr<TaskSchedulerImpl> Create(
42 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector, 42 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector,
43 const WorkerPoolIndexForTraitsCallback& 43 const WorkerPoolIndexForTraitsCallback&
44 worker_pool_index_for_traits_callback); 44 worker_pool_index_for_traits_callback);
45 45
46 ~TaskSchedulerImpl() override; 46 ~TaskSchedulerImpl() override;
47 47
48 // TaskScheduler: 48 // TaskScheduler:
49 void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here, 49 void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here,
50 const TaskTraits& traits, 50 const TaskTraits& traits,
51 const Closure& task, 51 Closure task,
52 TimeDelta delay) override; 52 TimeDelta delay) override;
53 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( 53 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(
54 const TaskTraits& traits) override; 54 const TaskTraits& traits) override;
55 scoped_refptr<SequencedTaskRunner> CreateSequencedTaskRunnerWithTraits( 55 scoped_refptr<SequencedTaskRunner> CreateSequencedTaskRunnerWithTraits(
56 const TaskTraits& traits) override; 56 const TaskTraits& traits) override;
57 scoped_refptr<SingleThreadTaskRunner> CreateSingleThreadTaskRunnerWithTraits( 57 scoped_refptr<SingleThreadTaskRunner> CreateSingleThreadTaskRunnerWithTraits(
58 const TaskTraits& traits) override; 58 const TaskTraits& traits) override;
59 std::vector<const HistogramBase*> GetHistograms() const override; 59 std::vector<const HistogramBase*> GetHistograms() const override;
60 int GetMaxConcurrentTasksWithTraitsDeprecated( 60 int GetMaxConcurrentTasksWithTraitsDeprecated(
61 const TaskTraits& traits) const override; 61 const TaskTraits& traits) const override;
(...skipping 29 matching lines...) Expand all
91 AtomicFlag join_for_testing_returned_; 91 AtomicFlag join_for_testing_returned_;
92 #endif 92 #endif
93 93
94 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); 94 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl);
95 }; 95 };
96 96
97 } // namespace internal 97 } // namespace internal
98 } // namespace base 98 } // namespace base
99 99
100 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 100 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698