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

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: Rebase and review changes. Created 8 years, 5 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 4b784ad0e17dd3803fc8b48bf208db35b7ddb3bf..96851d50632badb0704425319ccd233f14e8fa40 100644
--- a/chrome/renderer/resources/extensions/event.js
+++ b/chrome/renderer/resources/extensions/event.js
@@ -214,10 +214,9 @@
eventArgumentMassagers[name] = fn;
};
- // 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.dispatch = function(name, args) {
var listenerIDs = null;
if (filteringInfo) {
@@ -225,12 +224,6 @@
}
if (attachedNamedEvents[name]) {
if (args) {
- // 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);
- }
if (eventArgumentMassagers[name])
eventArgumentMassagers[name](args);
}

Powered by Google App Engine
This is Rietveld 408576698