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

Unified Diff: client/dart.js

Issue 11428064: Suppress check on localStorage to enable chrome apps (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Switch to try/catch 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 | no next file » | 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 1c8b333be70329f766432575e8955014a55d83ae..1777e22828b2c0745cd35cf093693840c22804d5 100644
--- a/client/dart.js
+++ b/client/dart.js
@@ -161,9 +161,14 @@ function ReceivePortSync() {
var stringified = JSON.stringify(serialize(port));
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;
+ // TODO(vsm): Phase out usage of localStorage and delete the
+ // below. We're leaving it in temporarily for backwards
+ // compatibility.
+ try {
+ window.localStorage[attrName] = stringified;
+ } catch (e) {
+ // Swallow errors (e.g., Chrome apps disallow this access).
+ }
};
window.lookupPort = function(name) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698