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

Unified Diff: base/values.h

Issue 1141793003: Update from https://crrev.com/329939 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/tuple.h ('k') | base/values.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.h
diff --git a/base/values.h b/base/values.h
index 1e1cae3a9a93efaeaa0cc46feb71a8c6d19b2890..e32edecf2ec347d3c146a86920cbec389f584147 100644
--- a/base/values.h
+++ b/base/values.h
@@ -64,7 +64,7 @@ class BASE_EXPORT Value {
virtual ~Value();
- static Value* CreateNullValue();
+ static scoped_ptr<Value> CreateNullValue();
// Returns the type of the value stored by the current Value object.
// Each type will be implemented by only one subclass of Value, so it's
@@ -99,6 +99,8 @@ class BASE_EXPORT Value {
// Subclasses return their own type directly in their overrides;
// this works because C++ supports covariant return types.
virtual Value* DeepCopy() const;
+ // Preferred version of DeepCopy. TODO(estade): remove the above.
+ scoped_ptr<Value> CreateDeepCopy() const;
// Compares if two Value objects have equal contents.
virtual bool Equals(const Value* other) const;
@@ -368,6 +370,8 @@ class BASE_EXPORT DictionaryValue : public Value {
// Overridden from Value:
DictionaryValue* DeepCopy() const override;
+ // Preferred version of DeepCopy. TODO(estade): remove the above.
+ scoped_ptr<DictionaryValue> CreateDeepCopy() const;
bool Equals(const Value* other) const override;
private:
@@ -400,6 +404,8 @@ class BASE_EXPORT ListValue : public Value {
// Returns true if successful, or false if the index was negative or
// the value is a null pointer.
bool Set(size_t index, Value* in_value);
+ // Preferred version of the above. TODO(estade): remove the above.
+ bool Set(size_t index, scoped_ptr<Value> in_value);
// Gets the Value at the given index. Modifies |out_value| (and returns true)
// only if the index falls within the current list range.
@@ -445,6 +451,8 @@ class BASE_EXPORT ListValue : public Value {
iterator Erase(iterator iter, scoped_ptr<Value>* out_value);
// Appends a Value to the end of the list.
+ void Append(scoped_ptr<Value> in_value);
+ // Deprecated version of the above. TODO(estade): remove.
void Append(Value* in_value);
// Convenience forms of Append.
@@ -486,6 +494,9 @@ class BASE_EXPORT ListValue : public Value {
ListValue* DeepCopy() const override;
bool Equals(const Value* other) const override;
+ // Preferred version of DeepCopy. TODO(estade): remove DeepCopy.
+ scoped_ptr<ListValue> CreateDeepCopy() const;
+
private:
ValueVector list_;
« no previous file with comments | « base/tuple.h ('k') | base/values.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698