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

Unified Diff: chrome/renderer/resources/extensions/event.js

Issue 23437015: Initial chrome.mdns API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable test for WinDbg 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
Index: chrome/renderer/resources/extensions/event.js
diff --git a/chrome/renderer/resources/extensions/event.js b/chrome/renderer/resources/extensions/event.js
index 13ad277481dc0391d4e8a3cb6ff8503cef33b67c..c6c5a0fc0151355d542192d2237caf3f213a3859 100644
--- a/chrome/renderer/resources/extensions/event.js
+++ b/chrome/renderer/resources/extensions/event.js
@@ -228,7 +228,7 @@
// Dispatches a named event with the given argument array. The args array is
// the list of arguments that will be sent to the event callback.
function dispatchEvent(name, args, filteringInfo) {
- var listenerIDs = null;
+ var listenerIDs = [];
if (filteringInfo)
listenerIDs = eventNatives.MatchAgainstEventFilter(name, filteringInfo);
@@ -262,7 +262,11 @@
if (!this.eventOptions_.supportsFilters)
throw new Error("This event does not support filters.");
if (filters.url && !(filters.url instanceof Array))
- throw new Error("filters.url should be an array");
+ throw new Error("filters.url should be an array.");
+ if (filters.serviceType &&
+ !(typeof filters.serviceType === 'string')) {
+ throw new Error("filters.serviceType should be a string.")
+ }
}
var listener = {callback: cb, filters: filters};
this.attach_(listener);
« no previous file with comments | « chrome/renderer/extensions/event_bindings.cc ('k') | chrome/test/data/extensions/api_test/mdns/api/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698