Index: base/values.h |
diff --git a/base/values.h b/base/values.h |
index e2506cc14f5515ab9fba9a76c1995fe8575dc9d5..f5d265fb369475baf12b264f415d742dfdf25f29 100644 |
--- a/base/values.h |
+++ b/base/values.h |
@@ -42,9 +42,6 @@ class ListValue; |
class StringValue; |
class Value; |
-typedef std::vector<Value*> ValueVector; |
-typedef std::map<std::string, Value*> ValueMap; |
- |
// The Value class is the base class for Values. A Value can be instantiated |
// via the Create*Value() factory methods, or by directly creating instances of |
// the subclasses. |
@@ -210,6 +207,7 @@ class BASE_EXPORT BinaryValue: public Value { |
// are |std::string|s and should be UTF-8 encoded. |
class BASE_EXPORT DictionaryValue : public Value { |
public: |
+ using Storage = std::map<std::string, std::unique_ptr<Value>>; |
// Returns |value| if it is a dictionary, nullptr otherwise. |
static std::unique_ptr<DictionaryValue> From(std::unique_ptr<Value> value); |
@@ -372,7 +370,7 @@ class BASE_EXPORT DictionaryValue : public Value { |
private: |
const DictionaryValue& target_; |
- ValueMap::const_iterator it_; |
+ Storage::const_iterator it_; |
}; |
// Overridden from Value: |
@@ -382,7 +380,7 @@ class BASE_EXPORT DictionaryValue : public Value { |
bool Equals(const Value* other) const override; |
private: |
- ValueMap dictionary_; |
+ Storage dictionary_; |
DISALLOW_COPY_AND_ASSIGN(DictionaryValue); |
}; |
@@ -390,8 +388,9 @@ class BASE_EXPORT DictionaryValue : public Value { |
// This type of Value represents a list of other Value values. |
class BASE_EXPORT ListValue : public Value { |
public: |
- typedef ValueVector::iterator iterator; |
- typedef ValueVector::const_iterator const_iterator; |
+ using Storage = std::vector<std::unique_ptr<Value>>; |
+ using const_iterator = Storage::const_iterator; |
+ using iterator = Storage::iterator; |
// Returns |value| if it is a list, nullptr otherwise. |
static std::unique_ptr<ListValue> From(std::unique_ptr<Value> value); |
@@ -508,7 +507,7 @@ class BASE_EXPORT ListValue : public Value { |
std::unique_ptr<ListValue> CreateDeepCopy() const; |
private: |
- ValueVector list_; |
+ Storage list_; |
DISALLOW_COPY_AND_ASSIGN(ListValue); |
}; |