| Index: tools/json_schema_compiler/util.h
|
| diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
|
| index d5eec1b2e1c49ee415e0b7fa209148a6f0d5c5f7..3365a4f69f6cb6e1177ce6f40fd0100d5cce278e 100644
|
| --- a/tools/json_schema_compiler/util.h
|
| +++ b/tools/json_schema_compiler/util.h
|
| @@ -8,7 +8,6 @@
|
| #include <string>
|
| #include <vector>
|
|
|
| -#include "base/memory/linked_ptr.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/values.h"
|
|
|
| @@ -18,7 +17,7 @@ namespace util {
|
|
|
| // Populates the item |out| from the value |from|. These are used by template
|
| // specializations of |Get(Optional)ArrayFromList|.
|
| -bool PopulateItem(const base::Value& from, linked_ptr<base::Value>* out);
|
| +bool PopulateItem(const base::Value& from, scoped_ptr<base::Value>* out);
|
|
|
| bool PopulateItem(const base::Value& from, int* out);
|
| bool PopulateItem(const base::Value& from, int* out, base::string16* error);
|
| @@ -35,25 +34,20 @@ bool PopulateItem(const base::Value& from,
|
| std::vector<char>* out,
|
| base::string16* error);
|
| bool PopulateItem(const base::Value& from,
|
| - linked_ptr<base::Value>* out,
|
| - base::string16* error);
|
| -bool PopulateItem(const base::Value& from, linked_ptr<base::Value>* out);
|
| -bool PopulateItem(const base::Value& from,
|
| - linked_ptr<base::DictionaryValue>* out);
|
| -bool PopulateItem(const base::Value& from,
|
| - linked_ptr<base::DictionaryValue>* out,
|
| + scoped_ptr<base::Value>* out,
|
| base::string16* error);
|
| +bool PopulateItem(const base::Value& from, scoped_ptr<base::Value>* out);
|
|
|
| // This template is used for types generated by tools/json_schema_compiler.
|
| template <class T>
|
| -bool PopulateItem(const base::Value& from, linked_ptr<T>* out) {
|
| +bool PopulateItem(const base::Value& from, scoped_ptr<T>* out) {
|
| const base::DictionaryValue* dict = nullptr;
|
| if (!from.GetAsDictionary(&dict))
|
| return false;
|
| scoped_ptr<T> obj(new T());
|
| if (!T::Populate(*dict, obj.get()))
|
| return false;
|
| - *out = linked_ptr<T>(obj.release());
|
| + *out = scoped_ptr<T>(obj.release());
|
| return true;
|
| }
|
|
|
| @@ -74,7 +68,7 @@ bool PopulateItem(const base::Value& from, T* out) {
|
| // error generation enabled.
|
| template <class T>
|
| bool PopulateItem(const base::Value& from,
|
| - linked_ptr<T>* out,
|
| + scoped_ptr<T>* out,
|
| base::string16* error) {
|
| const base::DictionaryValue* dict = nullptr;
|
| if (!from.GetAsDictionary(&dict))
|
| @@ -82,7 +76,7 @@ bool PopulateItem(const base::Value& from,
|
| scoped_ptr<T> obj(new T());
|
| if (!T::Populate(*dict, obj.get(), error))
|
| return false;
|
| - *out = linked_ptr<T>(obj.release());
|
| + *out = scoped_ptr<T>(obj.release());
|
| return true;
|
| }
|
|
|
| @@ -167,14 +161,14 @@ void AddItemToList(const bool from, base::ListValue* out);
|
| void AddItemToList(const double from, base::ListValue* out);
|
| void AddItemToList(const std::string& from, base::ListValue* out);
|
| void AddItemToList(const std::vector<char>& from, base::ListValue* out);
|
| -void AddItemToList(const linked_ptr<base::Value>& from, base::ListValue* out);
|
| -void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
|
| +void AddItemToList(const scoped_ptr<base::Value>& from, base::ListValue* out);
|
| +void AddItemToList(const scoped_ptr<base::DictionaryValue>& from,
|
| base::ListValue* out);
|
|
|
| // This template is used for types generated by tools/json_schema_compiler.
|
| template <class T>
|
| -void AddItemToList(const linked_ptr<T>& from, base::ListValue* out) {
|
| - out->Append(from->ToValue().release());
|
| +void AddItemToList(const scoped_ptr<T>& from, base::ListValue* out) {
|
| + out->Append(from->ToValue());
|
| }
|
|
|
| // This template is used for types generated by tools/json_schema_compiler.
|
|
|