| Index: tools/json_schema_compiler/util.cc
|
| diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
|
| index 2806cfcf0f923c268dc1d9dd284fbe67f136342f..3c4bebf69fe7b88d7252002956ec223ad951bc87 100644
|
| --- a/tools/json_schema_compiler/util.cc
|
| +++ b/tools/json_schema_compiler/util.cc
|
| @@ -9,36 +9,35 @@
|
| namespace json_schema_compiler {
|
| namespace util {
|
|
|
| -bool GetItemFromList(const base::ListValue& from, int index, int* out) {
|
| - return from.GetInteger(index, out);
|
| +bool PopulateItem(const base::Value& from, int* out) {
|
| + return from.GetAsInteger(out);
|
| }
|
|
|
| -bool GetItemFromList(const base::ListValue& from, int index, bool* out) {
|
| - return from.GetBoolean(index, out);
|
| +bool PopulateItem(const base::Value& from, bool* out) {
|
| + return from.GetAsBoolean(out);
|
| }
|
|
|
| -bool GetItemFromList(const base::ListValue& from, int index, double* out) {
|
| - return from.GetDouble(index, out);
|
| +bool PopulateItem(const base::Value& from, double* out) {
|
| + return from.GetAsDouble(out);
|
| }
|
|
|
| -bool GetItemFromList(const base::ListValue& from, int index, std::string* out) {
|
| - return from.GetString(index, out);
|
| +bool PopulateItem(const base::Value& from, std::string* out) {
|
| + return from.GetAsString(out);
|
| }
|
|
|
| -bool GetItemFromList(const base::ListValue& from,
|
| - int index,
|
| - linked_ptr<base::Value>* out) {
|
| - const base::Value* value = NULL;
|
| - if (!from.Get(index, &value))
|
| - return false;
|
| - *out = make_linked_ptr(value->DeepCopy());
|
| +bool PopulateStringFromBinary(const base::Value& from, std::string* out) {
|
| + return from.GetAsBinary(out);
|
| +}
|
| +
|
| +bool PopulateItem(const base::Value& from, linked_ptr<base::Value>* out) {
|
| + *out = make_linked_ptr(from.DeepCopy());
|
| return true;
|
| }
|
|
|
| -bool GetItemFromList(const base::ListValue& from, int index,
|
| - linked_ptr<base::DictionaryValue>* out) {
|
| +bool PopulateItem(const base::Value& from,
|
| + linked_ptr<base::DictionaryValue>* out) {
|
| const base::DictionaryValue* dict = NULL;
|
| - if (!from.GetDictionary(index, &dict))
|
| + if (!from.GetAsDictionary(&dict))
|
| return false;
|
| *out = make_linked_ptr(dict->DeepCopy());
|
| return true;
|
|
|