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

Unified Diff: base/values.cc

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 years, 7 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 | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.cc
diff --git a/base/values.cc b/base/values.cc
index f448f51d2bd3821005d85e976418882c1230466c..4093eba67aaf39be6ef8f648e49dfebacce1c39c 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -85,8 +85,8 @@ Value::~Value() {
}
// static
-Value* Value::CreateNullValue() {
- return new Value(TYPE_NULL);
+scoped_ptr<Value> Value::CreateNullValue() {
+ return make_scoped_ptr(new Value(TYPE_NULL));
}
bool Value::GetAsBinary(const BinaryValue** out_value) const {
@@ -137,7 +137,7 @@ Value* Value::DeepCopy() const {
// This method should only be getting called for null Values--all subclasses
// need to provide their own implementation;.
DCHECK(IsType(TYPE_NULL));
- return CreateNullValue();
+ return CreateNullValue().release();
}
scoped_ptr<Value> Value::CreateDeepCopy() const {
@@ -1137,6 +1137,10 @@ ListValue* ListValue::DeepCopy() const {
return result;
}
+scoped_ptr<ListValue> ListValue::CreateDeepCopy() const {
+ return make_scoped_ptr(DeepCopy());
+}
+
bool ListValue::Equals(const Value* other) const {
if (other->GetType() != GetType())
return false;
« no previous file with comments | « base/values.h ('k') | base/values_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698