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

Unified Diff: client/dart.js

Issue 11415064: Phase out local storage usage in PortSync code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge Created 8 years, 1 month 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 | « no previous file | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dart.js
diff --git a/client/dart.js b/client/dart.js
index c76e3fa5fad0d02620f7b0050b640179aa8c314a..1c8b333be70329f766432575e8955014a55d83ae 100644
--- a/client/dart.js
+++ b/client/dart.js
@@ -159,11 +159,21 @@ function ReceivePortSync() {
window.registerPort = function(name, port) {
var stringified = JSON.stringify(serialize(port));
- window.localStorage['dart-port:' + name] = stringified;
+ var attrName = 'dart-port:' + name;
+ document.documentElement.setAttribute(attrName, stringified);
+ // TODO(vsm): Phase out usage of localStorage. We're leaving it in
+ // temporarily for backwards compatibility.
+ window.localStorage[attrName] = stringified;
};
window.lookupPort = function(name) {
- var stringified = window.localStorage['dart-port:' + name];
+ var attrName = 'dart-port:' + name;
+ var stringified = document.documentElement.getAttribute(attrName);
+ // TODO(vsm): Phase out usage of localStorage. We're leaving it in
+ // temporarily for backwards compatibility.
+ if (!stringified) {
+ stringified = window.localStorage[attrName];
+ }
return deserialize(JSON.parse(stringified));
};
« no previous file with comments | « no previous file | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698