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 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 #include "base/sequenced_task_runner_helpers.h" | 9 #include "base/sequenced_task_runner_helpers.h" |
10 #include "base/task_runner.h" | 10 #include "base/task_runner.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // and false if the object definitely will not be released. | 132 // and false if the object definitely will not be released. |
133 template <class T> | 133 template <class T> |
134 bool ReleaseSoon(const tracked_objects::Location& from_here, | 134 bool ReleaseSoon(const tracked_objects::Location& from_here, |
135 T* object) { | 135 T* object) { |
136 return | 136 return |
137 subtle::ReleaseHelperInternal<T, bool>::ReleaseViaSequencedTaskRunner( | 137 subtle::ReleaseHelperInternal<T, bool>::ReleaseViaSequencedTaskRunner( |
138 this, from_here, object); | 138 this, from_here, object); |
139 } | 139 } |
140 | 140 |
141 protected: | 141 protected: |
142 virtual ~SequencedTaskRunner() {} | 142 ~SequencedTaskRunner() override {} |
143 | 143 |
144 private: | 144 private: |
145 template <class T, class R> friend class subtle::DeleteHelperInternal; | 145 template <class T, class R> friend class subtle::DeleteHelperInternal; |
146 template <class T, class R> friend class subtle::ReleaseHelperInternal; | 146 template <class T, class R> friend class subtle::ReleaseHelperInternal; |
147 | 147 |
148 bool DeleteSoonInternal(const tracked_objects::Location& from_here, | 148 bool DeleteSoonInternal(const tracked_objects::Location& from_here, |
149 void(*deleter)(const void*), | 149 void(*deleter)(const void*), |
150 const void* object); | 150 const void* object); |
151 | 151 |
152 bool ReleaseSoonInternal(const tracked_objects::Location& from_here, | 152 bool ReleaseSoonInternal(const tracked_objects::Location& from_here, |
153 void(*releaser)(const void*), | 153 void(*releaser)(const void*), |
154 const void* object); | 154 const void* object); |
155 }; | 155 }; |
156 | 156 |
157 } // namespace base | 157 } // namespace base |
158 | 158 |
159 #endif // BASE_SEQUENCED_TASKRUNNER_H_ | 159 #endif // BASE_SEQUENCED_TASKRUNNER_H_ |
OLD | NEW |