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

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

Issue 2936673004: Revert of [Extensions Bindings] Avoid passing the event filter to JS (Closed)
Patch Set: Created 3 years, 6 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 | « extensions/renderer/js_extension_bindings_system.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/event.js
diff --git a/extensions/renderer/resources/event.js b/extensions/renderer/resources/event.js
index 9e7226be14d7007c0867551aeefd11354dbcecac..2cbf48b9ef98cb3918edbc89d03bd2e0ce90b75e 100644
--- a/extensions/renderer/resources/event.js
+++ b/extensions/renderer/resources/event.js
@@ -241,15 +241,18 @@
// 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.
- // |listenerIds| contains the ids of matching listeners, or is an empty array
- // for all listeners.
- function dispatchEvent(name, args, listenerIds) {
+ function dispatchEvent(name, args, filteringInfo) {
+ var listenerIDs = [];
+
+ if (filteringInfo)
+ listenerIDs = eventNatives.MatchAgainstEventFilter(name, filteringInfo);
+
var event = attachedNamedEvents[name];
if (!event)
return;
var dispatchArgs = function(args) {
- var result = event.dispatch_(args, listenerIds);
+ var result = event.dispatch_(args, listenerIDs);
if (result)
logging.DCHECK(!result.validationErrors, result.validationErrors);
return result;
« no previous file with comments | « extensions/renderer/js_extension_bindings_system.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698