| Index: extensions/renderer/api_binding.cc
|
| diff --git a/extensions/renderer/api_binding.cc b/extensions/renderer/api_binding.cc
|
| index 163858dbc6503b311b05aaf14e20f6b44b196a14..bf559f995355231fd20557ecbba4e48a311eae88 100644
|
| --- a/extensions/renderer/api_binding.cc
|
| +++ b/extensions/renderer/api_binding.cc
|
| @@ -64,7 +64,7 @@ void CallbackHelper(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| } // namespace
|
|
|
| APIBinding::APIBinding(const std::string& api_name,
|
| - const base::ListValue& function_definitions,
|
| + const base::ListValue* function_definitions,
|
| const base::ListValue* type_definitions,
|
| const base::ListValue* event_definitions,
|
| const APIMethodCallback& callback,
|
| @@ -76,15 +76,17 @@ APIBinding::APIBinding(const std::string& api_name,
|
| type_refs_(type_refs),
|
| weak_factory_(this) {
|
| DCHECK(!method_callback_.is_null());
|
| - for (const auto& func : function_definitions) {
|
| - const base::DictionaryValue* func_dict = nullptr;
|
| - CHECK(func->GetAsDictionary(&func_dict));
|
| - std::string name;
|
| - CHECK(func_dict->GetString("name", &name));
|
| -
|
| - const base::ListValue* params = nullptr;
|
| - CHECK(func_dict->GetList("parameters", ¶ms));
|
| - signatures_[name] = base::MakeUnique<APISignature>(*params);
|
| + if (function_definitions) {
|
| + for (const auto& func : *function_definitions) {
|
| + const base::DictionaryValue* func_dict = nullptr;
|
| + CHECK(func->GetAsDictionary(&func_dict));
|
| + std::string name;
|
| + CHECK(func_dict->GetString("name", &name));
|
| +
|
| + const base::ListValue* params = nullptr;
|
| + CHECK(func_dict->GetList("parameters", ¶ms));
|
| + signatures_[name] = base::MakeUnique<APISignature>(*params);
|
| + }
|
| }
|
| if (type_definitions) {
|
| for (const auto& type : *type_definitions) {
|
|
|