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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // true if the object may be released at some point in the future, | 136 // true if the object may be released at some point in the future, |
137 // and false if the object definitely will not be released. | 137 // and false if the object definitely will not be released. |
138 template <class T> | 138 template <class T> |
139 bool ReleaseSoon(const tracked_objects::Location& from_here, | 139 bool ReleaseSoon(const tracked_objects::Location& from_here, |
140 T* object) { | 140 T* object) { |
141 return | 141 return |
142 subtle::ReleaseHelperInternal<T, bool>::ReleaseViaSequencedTaskRunner( | 142 subtle::ReleaseHelperInternal<T, bool>::ReleaseViaSequencedTaskRunner( |
143 this, from_here, object); | 143 this, from_here, object); |
144 } | 144 } |
145 | 145 |
146 private: | 146 protected: |
| 147 virtual ~SequencedTaskRunner() {} |
| 148 |
| 149 private: |
147 template <class T, class R> friend class subtle::DeleteHelperInternal; | 150 template <class T, class R> friend class subtle::DeleteHelperInternal; |
148 template <class T, class R> friend class subtle::ReleaseHelperInternal; | 151 template <class T, class R> friend class subtle::ReleaseHelperInternal; |
149 | 152 |
150 bool DeleteSoonInternal(const tracked_objects::Location& from_here, | 153 bool DeleteSoonInternal(const tracked_objects::Location& from_here, |
151 void(*deleter)(const void*), | 154 void(*deleter)(const void*), |
152 const void* object); | 155 const void* object); |
153 | 156 |
154 bool ReleaseSoonInternal(const tracked_objects::Location& from_here, | 157 bool ReleaseSoonInternal(const tracked_objects::Location& from_here, |
155 void(*releaser)(const void*), | 158 void(*releaser)(const void*), |
156 const void* object); | 159 const void* object); |
157 }; | 160 }; |
158 | 161 |
159 } // namespace base | 162 } // namespace base |
160 | 163 |
161 #endif // BASE_SEQUENCED_TASKRUNNER_H_ | 164 #endif // BASE_SEQUENCED_TASKRUNNER_H_ |
OLD | NEW |