Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4710)

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 23923003: Expand RuntimeErrors for ErrorConsole (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copyright fix Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/renderer/extensions/event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index 7ed9437eb12539c5f71807233a45a6d0d2980ca6..aadb18c2390aa0cb8726375387c432ad3309495d 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -78,6 +78,7 @@
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/v8_value_converter.h"
#include "extensions/common/constants.h"
+#include "extensions/common/extension_urls.h"
#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_provider.h"
#include "extensions/common/manifest.h"
@@ -118,7 +119,6 @@ namespace {
static const int64 kInitialExtensionIdleHandlerDelayMs = 5*1000;
static const int64 kMaxExtensionIdleHandlerDelayMs = 5*60*1000;
-static const char kEventModule[] = "event_bindings";
static const char kEventDispatchFunction[] = "dispatchEvent";
// Returns the global value for "chrome" from |context|. If one doesn't exist
@@ -905,12 +905,12 @@ void Dispatcher::PopulateSourceMap() {
// Libraries.
source_map_.RegisterSource("contentWatcher", IDR_CONTENT_WATCHER_JS);
source_map_.RegisterSource("entryIdManager", IDR_ENTRY_ID_MANAGER);
- source_map_.RegisterSource(kEventModule, IDR_EVENT_BINDINGS_JS);
+ source_map_.RegisterSource(kEventBindings, IDR_EVENT_BINDINGS_JS);
source_map_.RegisterSource("imageUtil", IDR_IMAGE_UTIL_JS);
source_map_.RegisterSource("json_schema", IDR_JSON_SCHEMA_JS);
source_map_.RegisterSource("lastError", IDR_LAST_ERROR_JS);
source_map_.RegisterSource("messaging", IDR_MESSAGING_JS);
- source_map_.RegisterSource("schemaUtils", IDR_SCHEMA_UTILS_JS);
+ source_map_.RegisterSource(kSchemaUtils, IDR_SCHEMA_UTILS_JS);
source_map_.RegisterSource("sendRequest", IDR_SEND_REQUEST_JS);
source_map_.RegisterSource("setIcon", IDR_SET_ICON_JS);
source_map_.RegisterSource("test", IDR_TEST_CUSTOM_BINDINGS_JS);
@@ -1091,7 +1091,7 @@ void Dispatcher::DidCreateScriptContext(
if (context->extension()) {
v8::Handle<v8::Object> chrome = AsObjectOrEmpty(GetOrCreateChrome(context));
if (!chrome.IsEmpty())
- module_system->SetLazyField(chrome, "Event", kEventModule, "Event");
+ module_system->SetLazyField(chrome, "Event", kEventBindings, "Event");
}
AddOrRemoveBindingsForContext(context);
@@ -1521,11 +1521,14 @@ void Dispatcher::DispatchEvent(const std::string& extension_id,
base::ListValue args;
args.Set(0, new base::StringValue(event_name));
args.Set(1, new base::ListValue());
+
+ // Needed for Windows compilation, since kEventBindings is declared extern.
+ const char* local_event_bindings = kEventBindings;
v8_context_set_.ForEach(
extension_id,
NULL, // all render views
base::Bind(&CallModuleMethod,
- kEventModule,
+ local_event_bindings,
kEventDispatchFunction,
&args));
}
@@ -1557,7 +1560,7 @@ void Dispatcher::InvokeModuleSystemMethod(
// background page active.
const Extension* extension = extensions_.GetByID(extension_id);
if (extension && BackgroundInfo::HasLazyBackgroundPage(extension) &&
- module_name == kEventModule &&
+ module_name == kEventBindings &&
function_name == kEventDispatchFunction) {
RenderView* background_view =
ExtensionHelper::GetBackgroundPage(extension_id);
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/renderer/extensions/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698