| Index: extensions/renderer/native_extension_bindings_system.cc
|
| diff --git a/extensions/renderer/native_extension_bindings_system.cc b/extensions/renderer/native_extension_bindings_system.cc
|
| index 9924a14e59e5d381e66c604b9b5ec04c55417973..87ee7f8ce8fe7423ef39a788a62aed026e38948c 100644
|
| --- a/extensions/renderer/native_extension_bindings_system.cc
|
| +++ b/extensions/renderer/native_extension_bindings_system.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/command_line.h"
|
| #include "base/memory/ptr_util.h"
|
| +#include "content/public/common/console_message_level.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "extensions/common/constants.h"
|
| #include "extensions/common/event_filtering_info.h"
|
| @@ -164,6 +165,14 @@ v8::Global<v8::Value> CallJsFunctionSync(v8::Local<v8::Function> function,
|
| return result;
|
| }
|
|
|
| +void AddConsoleError(v8::Local<v8::Context> context, const std::string& error) {
|
| + ScriptContext* script_context =
|
| + ScriptContextSet::GetContextByV8Context(context);
|
| + CHECK(script_context);
|
| + script_context->AddMessageToConsole(content::CONSOLE_MESSAGE_LEVEL_ERROR,
|
| + error);
|
| +}
|
| +
|
| // Returns the API schema indicated by |api_name|.
|
| const base::DictionaryValue& GetAPISchema(const std::string& api_name) {
|
| const base::DictionaryValue* schema =
|
| @@ -335,7 +344,7 @@ NativeExtensionBindingsSystem::NativeExtensionBindingsSystem(
|
| base::Unretained(this)),
|
| base::Bind(&NativeExtensionBindingsSystem::OnEventListenerChanged,
|
| base::Unretained(this)),
|
| - APILastError(base::Bind(&GetRuntime))),
|
| + APILastError(base::Bind(&GetRuntime), base::Bind(&AddConsoleError))),
|
| weak_factory_(this) {
|
| api_system_.RegisterCustomType("storage.StorageArea",
|
| base::Bind(&StorageArea::CreateStorageArea));
|
|
|