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

Unified Diff: base/sequenced_task_runner.h

Issue 2686033002: Simplify SequencedTaskRunner::{Delete,Releaose}Soon impl (Closed)
Patch Set: public -> private Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/sequenced_task_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sequenced_task_runner.h
diff --git a/base/sequenced_task_runner.h b/base/sequenced_task_runner.h
index de91bd9285b2f35fd952642e9439d8e35935b331..6b2726ed4fe74c4e1208e1514d391191985692e2 100644
--- a/base/sequenced_task_runner.h
+++ b/base/sequenced_task_runner.h
@@ -122,9 +122,8 @@ class BASE_EXPORT SequencedTaskRunner : public TaskRunner {
template <class T>
bool DeleteSoon(const tracked_objects::Location& from_here,
const T* object) {
- return
- subtle::DeleteHelperInternal<T, bool>::DeleteViaSequencedTaskRunner(
- this, from_here, object);
+ return DeleteOrReleaseSoonInternal(from_here, &DeleteHelper<T>::DoDelete,
+ object);
}
// Submits a non-nestable task to release the given object. Returns
@@ -132,26 +131,18 @@ class BASE_EXPORT SequencedTaskRunner : public TaskRunner {
// and false if the object definitely will not be released.
template <class T>
bool ReleaseSoon(const tracked_objects::Location& from_here,
- T* object) {
- return
- subtle::ReleaseHelperInternal<T, bool>::ReleaseViaSequencedTaskRunner(
- this, from_here, object);
+ const T* object) {
+ return DeleteOrReleaseSoonInternal(from_here, &ReleaseHelper<T>::DoRelease,
+ object);
}
protected:
~SequencedTaskRunner() override {}
private:
- template <class T, class R> friend class subtle::DeleteHelperInternal;
- template <class T, class R> friend class subtle::ReleaseHelperInternal;
-
- bool DeleteSoonInternal(const tracked_objects::Location& from_here,
- void(*deleter)(const void*),
- const void* object);
-
- bool ReleaseSoonInternal(const tracked_objects::Location& from_here,
- void(*releaser)(const void*),
- const void* object);
+ bool DeleteOrReleaseSoonInternal(const tracked_objects::Location& from_here,
+ void (*deleter)(const void*),
+ const void* object);
};
struct BASE_EXPORT OnTaskRunnerDeleter {
« no previous file with comments | « no previous file | base/sequenced_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698