aboutsummaryrefslogtreecommitdiff
path: root/third_party/chromium/base/values.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/chromium/base/values.h')
-rw-r--r--third_party/chromium/base/values.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/third_party/chromium/base/values.h b/third_party/chromium/base/values.h
index fca5239..d5c43ef 100644
--- a/third_party/chromium/base/values.h
+++ b/third_party/chromium/base/values.h
@@ -41,9 +41,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.
@@ -179,7 +176,8 @@ class BASE_EXPORT BinaryValue : public Value {
// For situations where you want to keep ownership of your buffer, this
// factory method creates a new BinaryValue by copying the contents of the
// buffer that's passed in.
- static BinaryValue* CreateWithCopiedBuffer(const char* buffer, size_t size);
+ static std::unique_ptr<BinaryValue> CreateWithCopiedBuffer(const char* buffer,
+ size_t size);
size_t GetSize() const { return size_; }
@@ -204,6 +202,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);
@@ -360,7 +359,7 @@ class BASE_EXPORT DictionaryValue : public Value {
private:
const DictionaryValue& target_;
- ValueMap::const_iterator it_;
+ Storage::const_iterator it_;
};
// Overridden from Value:
@@ -370,7 +369,7 @@ class BASE_EXPORT DictionaryValue : public Value {
bool Equals(const Value* other) const override;
private:
- ValueMap dictionary_;
+ Storage dictionary_;
DISALLOW_COPY_AND_ASSIGN(DictionaryValue);
};
@@ -378,8 +377,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);
@@ -493,7 +493,7 @@ class BASE_EXPORT ListValue : public Value {
std::unique_ptr<ListValue> CreateDeepCopy() const;
private:
- ValueVector list_;
+ Storage list_;
DISALLOW_COPY_AND_ASSIGN(ListValue);
};