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

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

Issue 10694085: Refactor extension event distribution to use Values instead of JSON strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing memory leak in a test. Created 8 years, 4 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/renderer/extensions/dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/event.js
diff --git a/chrome/renderer/resources/extensions/event.js b/chrome/renderer/resources/extensions/event.js
index 4b0da04f17cb283ae6c57577ba356f32e3adfa57..f342014fdda09db0652e8d08c3778d0f9e3c99f9 100644
--- a/chrome/renderer/resources/extensions/event.js
+++ b/chrome/renderer/resources/extensions/event.js
@@ -210,7 +210,7 @@
chromeHidden.Event = {};
// callback is a function(args, dispatch). args are the args we receive from
- // dispatchJSON(), and dispatch is a function(args) that dispatches args to
+ // dispatchEvent(), and dispatch is a function(args) that dispatches args to
// its listeners.
chromeHidden.Event.registerArgumentMassager = function(name, callback) {
if (eventArgumentMassagers[name])
@@ -218,10 +218,9 @@
eventArgumentMassagers[name] = callback;
};
- // Dispatches a named event with the given JSON array, which is deserialized
- // before dispatch. The JSON array is the list of arguments that will be
- // sent with the event callback.
- chromeHidden.Event.dispatchJSON = function(name, args, filteringInfo) {
+ // 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.
+ chromeHidden.Event.dispatchEvent = function(name, args, filteringInfo) {
var listenerIDs = null;
if (filteringInfo)
@@ -231,12 +230,6 @@
if (!event)
return;
- // TODO(asargent): This is an antiquity. Until all callers of
- // dispatchJSON use actual values, this must remain here to catch the
- // cases where a caller has hard-coded a JSON string to pass in.
- if (typeof(args) == "string")
- args = chromeHidden.JSON.parse(args);
-
var dispatchArgs = function(args) {
result = event.dispatch_(args, listenerIDs);
if (result)
« no previous file with comments | « chrome/renderer/extensions/dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698