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

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

Issue 10566018: Initial work to remove the notion of all extension message payloads as strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review changes. Created 8 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
Index: chrome/renderer/resources/extensions/event.js
diff --git a/chrome/renderer/resources/extensions/event.js b/chrome/renderer/resources/extensions/event.js
index a69e47428c43ad2515a2f8091be4ea011ab1f3a2..a6d636342eea978f3568208f7345f8b763559306 100644
--- a/chrome/renderer/resources/extensions/event.js
+++ b/chrome/renderer/resources/extensions/event.js
@@ -139,7 +139,12 @@
chromeHidden.Event.dispatchJSON = function(name, args) {
if (attachedNamedEvents[name]) {
if (args) {
- args = chromeHidden.JSON.parse(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);
}
« no previous file with comments | « chrome/browser/extensions/extension_event_router.cc ('k') | chrome/renderer/resources/extensions/schema_utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698