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

Unified Diff: base/memory/scoped_ptr.h

Issue 7795008: Remove the free_ member of scoped_ptr_malloc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/scoped_ptr.h
diff --git a/base/memory/scoped_ptr.h b/base/memory/scoped_ptr.h
index 1067d428380135cd8d9be4f19d882d6b63c33f5c..5db06c8aa99691909583563d6ee7ee5050071e76 100644
--- a/base/memory/scoped_ptr.h
+++ b/base/memory/scoped_ptr.h
@@ -285,7 +285,7 @@ class scoped_ptr_malloc {
// Destructor. If there is a C object, call the Free functor.
~scoped_ptr_malloc() {
- free_(ptr_);
+ FreeProc()(ptr_);
awong 2011/08/29 21:45:11 nit: What about saving it into a temporary before
}
// Reset. Calls the Free functor on the current owned object, if any.
@@ -293,7 +293,7 @@ class scoped_ptr_malloc {
// this->reset(this->get()) works.
void reset(C* p = NULL) {
if (ptr_ != p) {
- free_(ptr_);
+ FreeProc()(ptr_);
ptr_ = p;
}
}
@@ -355,16 +355,11 @@ class scoped_ptr_malloc {
template <class C2, class GP>
bool operator!=(scoped_ptr_malloc<C2, GP> const& p) const;
- static FreeProc const free_;
-
// Disallow evil constructors
scoped_ptr_malloc(const scoped_ptr_malloc&);
void operator=(const scoped_ptr_malloc&);
};
-template<class C, class FP>
-FP const scoped_ptr_malloc<C, FP>::free_ = FP();
-
template<class C, class FP> inline
void swap(scoped_ptr_malloc<C, FP>& a, scoped_ptr_malloc<C, FP>& b) {
a.swap(b);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698