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

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

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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 | « base/task_scheduler/task_scheduler.h ('k') | base/task_scheduler/task_scheduler_impl.cc » ('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_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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 worker_pool_index_for_traits_callback); 47 worker_pool_index_for_traits_callback);
48 48
49 // Destroying a TaskSchedulerImpl is not allowed in production; it is always 49 // Destroying a TaskSchedulerImpl is not allowed in production; it is always
50 // leaked. In tests, it can only be destroyed after JoinForTesting() has 50 // leaked. In tests, it can only be destroyed after JoinForTesting() has
51 // returned. 51 // returned.
52 ~TaskSchedulerImpl() override; 52 ~TaskSchedulerImpl() override;
53 53
54 // TaskScheduler: 54 // TaskScheduler:
55 void PostTaskWithTraits(const tracked_objects::Location& from_here, 55 void PostTaskWithTraits(const tracked_objects::Location& from_here,
56 const TaskTraits& traits, 56 const TaskTraits& traits,
57 const Closure& task) override; 57 OnceClosure task) override;
58 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits( 58 scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(
59 const TaskTraits& traits, 59 const TaskTraits& traits,
60 ExecutionMode execution_mode) override; 60 ExecutionMode execution_mode) override;
61 void Shutdown() override; 61 void Shutdown() override;
62 62
63 // Joins all threads of this scheduler. Tasks that are already running are 63 // Joins all threads of this scheduler. Tasks that are already running are
64 // allowed to complete their execution. This can only be called once. 64 // allowed to complete their execution. This can only be called once.
65 void JoinForTesting(); 65 void JoinForTesting();
66 66
67 private: 67 private:
(...skipping 25 matching lines...) Expand all
93 AtomicFlag join_for_testing_returned_; 93 AtomicFlag join_for_testing_returned_;
94 #endif 94 #endif
95 95
96 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); 96 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl);
97 }; 97 };
98 98
99 } // namespace internal 99 } // namespace internal
100 } // namespace base 100 } // namespace base
101 101
102 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 102 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « base/task_scheduler/task_scheduler.h ('k') | base/task_scheduler/task_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698