| Index: tools/json_schema_compiler/util.cc
|
| diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
|
| index 468df83b297ab0407c3983e4cdf5eb109ef78fd2..9d8abd5cdab51e75e72ce5e9dc54089e8109d1fa 100644
|
| --- a/tools/json_schema_compiler/util.cc
|
| +++ b/tools/json_schema_compiler/util.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "tools/json_schema_compiler/any.h"
|
| #include "tools/json_schema_compiler/util.h"
|
|
|
| #include "base/values.h"
|
| @@ -26,11 +27,21 @@ bool GetItemFromList(const ListValue& from, int index, std::string* out) {
|
| }
|
|
|
| bool GetItemFromList(const ListValue& from, int index,
|
| + linked_ptr<any::Any>* out) {
|
| + Value* value = NULL;
|
| + if (!from.Get(index, &value))
|
| + return false;
|
| + scoped_ptr<any::Any> any_object(new any::Any());
|
| + any_object->Init(*value);
|
| + *out = linked_ptr<any::Any>(any_object.release());
|
| + return true;
|
| +}
|
| +
|
| +bool GetItemFromList(const ListValue& from, int index,
|
| linked_ptr<base::DictionaryValue>* out) {
|
| DictionaryValue* dict = NULL;
|
| - if (!from.GetDictionary(index, &dict)) {
|
| + if (!from.GetDictionary(index, &dict))
|
| return false;
|
| - }
|
| *out = linked_ptr<DictionaryValue>(dict->DeepCopy());
|
| return true;
|
| }
|
| @@ -51,6 +62,10 @@ void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
|
| base::ListValue* out) {
|
| out->Append(static_cast<Value*>(from->DeepCopy()));
|
| }
|
| +void AddItemToList(const linked_ptr<any::Any>& from,
|
| + base::ListValue* out) {
|
| + out->Append(from->value().DeepCopy());
|
| +}
|
|
|
| } // namespace api_util
|
| } // namespace extensions
|
|
|