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

Unified Diff: base/memory/scoped_ptr.h

Issue 10544185: Order the script badges in the location bar consistently (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 years, 6 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
Index: base/memory/scoped_ptr.h
diff --git a/base/memory/scoped_ptr.h b/base/memory/scoped_ptr.h
index bc38c8d9b77f7ee68da916627c0a21f0d8cb9805..022b6ad766cb5f83761a203ae75751963c90e553 100644
--- a/base/memory/scoped_ptr.h
+++ b/base/memory/scoped_ptr.h
@@ -493,4 +493,24 @@ bool operator!=(C* p, const scoped_ptr_malloc<C, FP>& b) {
return p != b.get();
}
+template <typename T>
+scoped_ptr<T> make_scoped_ptr() {
willchan no longer on Chromium 2012/06/15 23:15:01 Can't we change this to take T*?
Jeffrey Yasskin 2012/06/15 23:17:38 This could use a comment like // Use this as: //
willchan no longer on Chromium 2012/06/18 03:16:53 My initial inclination was to reject this, because
Jeffrey Yasskin 2012/06/18 05:42:15 Interestingly, make_scoped_refptr doesn't take own
not at google - send to devlin 2012/06/18 17:50:27 I think that... consistency with make_linked_ptr w
willchan no longer on Chromium 2012/06/18 18:52:32 I don't think it'll go away (did I say that? if so
+ return scoped_ptr<T>(new T());
+}
+
+template <typename T, typename A1>
+scoped_ptr<T> make_scoped_ptr(const A1& a1) {
+ return scoped_ptr<T>(new T(a1));
+}
+
+template <typename T, typename A1, typename A2>
+scoped_ptr<T> make_scoped_ptr(const A1& a1, const A2& a2) {
+ return scoped_ptr<T>(new T(a1, a2));
+}
+
+template <typename T, typename A1, typename A2, typename A3>
+scoped_ptr<T> make_scoped_ptr(const A1& a1, const A2& a2, const A3& a3) {
+ return scoped_ptr<T>(new T(a1, a2, a3));
+}
+
#endif // BASE_MEMORY_SCOPED_PTR_H_

Powered by Google App Engine
This is Rietveld 408576698