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

Unified Diff: base/callback_internal.h

Issue 11149006: Extend scoped_ptr to be closer to unique_ptr. Support custom deleters, and deleting arrays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix cut/paste error Created 8 years, 1 month 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/memory/scoped_ptr.h » ('j') | base/memory/scoped_ptr.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_internal.h
diff --git a/base/callback_internal.h b/base/callback_internal.h
index 2f834c368f15579ea428b37587943b16a0466407..d9aba39fc37f8411ec018338e2d6bf396fd7c2c2 100644
--- a/base/callback_internal.h
+++ b/base/callback_internal.h
@@ -130,10 +130,10 @@ struct CallbackParamTraits<T[]> {
// TODO(ajwong): We might be able to use SFINAE to search for the existence of
// a Pass() function in the type and avoid the whitelist in CallbackParamTraits
// and CallbackForward.
-template <typename T>
-struct CallbackParamTraits<scoped_ptr<T> > {
- typedef scoped_ptr<T> ForwardType;
- typedef scoped_ptr<T> StorageType;
+template <typename T, typename D>
+struct CallbackParamTraits<scoped_ptr<T, D> > {
+ typedef scoped_ptr<T, D> ForwardType;
+ typedef scoped_ptr<T, D> StorageType;
};
template <typename T>
@@ -173,8 +173,8 @@ struct CallbackParamTraits<ScopedVector<T> > {
template <typename T>
T& CallbackForward(T& t) { return t; }
-template <typename T>
-scoped_ptr<T> CallbackForward(scoped_ptr<T>& p) { return p.Pass(); }
+template <typename T, typename D>
+scoped_ptr<T, D> CallbackForward(scoped_ptr<T, D>& p) { return p.Pass(); }
template <typename T>
scoped_array<T> CallbackForward(scoped_array<T>& p) { return p.Pass(); }
« no previous file with comments | « no previous file | base/memory/scoped_ptr.h » ('j') | base/memory/scoped_ptr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698