OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SEQUENCED_TASKRUNNER_H_ | 5 #ifndef BASE_SEQUENCED_TASKRUNNER_H_ |
6 #define BASE_SEQUENCED_TASKRUNNER_H_ | 6 #define BASE_SEQUENCED_TASKRUNNER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
10 #include "base/sequenced_task_runner_helpers.h" | 10 #include "base/sequenced_task_runner_helpers.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // TODO(akalin): Get rid of the boolean return value for the methods | 108 // TODO(akalin): Get rid of the boolean return value for the methods |
109 // below. | 109 // below. |
110 | 110 |
111 bool PostNonNestableTask(const tracked_objects::Location& from_here, | 111 bool PostNonNestableTask(const tracked_objects::Location& from_here, |
112 const Closure& task); | 112 const Closure& task); |
113 | 113 |
114 virtual bool PostNonNestableDelayedTask( | 114 virtual bool PostNonNestableDelayedTask( |
115 const tracked_objects::Location& from_here, | 115 const tracked_objects::Location& from_here, |
116 const Closure& task, | 116 const Closure& task, |
117 int64 delay_ms) = 0; | |
118 | |
119 virtual bool PostNonNestableDelayedTask( | |
120 const tracked_objects::Location& from_here, | |
121 const Closure& task, | |
122 base::TimeDelta delay) = 0; | 117 base::TimeDelta delay) = 0; |
123 | 118 |
124 // Submits a non-nestable task to delete the given object. Returns | 119 // Submits a non-nestable task to delete the given object. Returns |
125 // true if the object may be deleted at some point in the future, | 120 // true if the object may be deleted at some point in the future, |
126 // and false if the object definitely will not be deleted. | 121 // and false if the object definitely will not be deleted. |
127 template <class T> | 122 template <class T> |
128 bool DeleteSoon(const tracked_objects::Location& from_here, | 123 bool DeleteSoon(const tracked_objects::Location& from_here, |
129 const T* object) { | 124 const T* object) { |
130 return | 125 return |
131 subtle::DeleteHelperInternal<T, bool>::DeleteViaSequencedTaskRunner( | 126 subtle::DeleteHelperInternal<T, bool>::DeleteViaSequencedTaskRunner( |
(...skipping 23 matching lines...) Expand all Loading... |
155 const void* object); | 150 const void* object); |
156 | 151 |
157 bool ReleaseSoonInternal(const tracked_objects::Location& from_here, | 152 bool ReleaseSoonInternal(const tracked_objects::Location& from_here, |
158 void(*releaser)(const void*), | 153 void(*releaser)(const void*), |
159 const void* object); | 154 const void* object); |
160 }; | 155 }; |
161 | 156 |
162 } // namespace base | 157 } // namespace base |
163 | 158 |
164 #endif // BASE_SEQUENCED_TASKRUNNER_H_ | 159 #endif // BASE_SEQUENCED_TASKRUNNER_H_ |
OLD | NEW |