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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/dart.js ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:isolate'; 3 import 'dart:isolate';
4 import 'dart:json'; 4 import 'dart:json';
5 import 'dart:svg' as svg; 5 import 'dart:svg' as svg;
6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
7 // for details. All rights reserved. Use of this source code is governed by a 7 // for details. All rights reserved. Use of this source code is governed by a
8 // BSD-style license that can be found in the LICENSE file. 8 // BSD-style license that can be found in the LICENSE file.
9 9
10 // DO NOT EDIT 10 // DO NOT EDIT
(...skipping 11983 matching lines...) Expand 10 before | Expand all | Expand 10 after
11994 IDBFactory get indexedDB() => 11994 IDBFactory get indexedDB() =>
11995 JS('IDBFactory', 11995 JS('IDBFactory',
11996 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', 11996 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
11997 this, this, this); 11997 this, this, this);
11998 11998
11999 /** 11999 /**
12000 * Lookup a port by its [name]. Return null if no port is 12000 * Lookup a port by its [name]. Return null if no port is
12001 * registered under [name]. 12001 * registered under [name].
12002 */ 12002 */
12003 SendPortSync lookupPort(String name) { 12003 SendPortSync lookupPort(String name) {
12004 var port = JSON.parse(localStorage['dart-port:$name']); 12004 var port = JSON.parse(document.documentElement.attributes['dart-port:$name'] );
12005 return _deserialize(port); 12005 return _deserialize(port);
12006 } 12006 }
12007 12007
12008 /** 12008 /**
12009 * Register a [port] on this window under the given [name]. This 12009 * Register a [port] on this window under the given [name]. This
12010 * port may be retrieved by any isolate (or JavaScript script) 12010 * port may be retrieved by any isolate (or JavaScript script)
12011 * running in this window. 12011 * running in this window.
12012 */ 12012 */
12013 void registerPort(String name, var port) { 12013 void registerPort(String name, var port) {
12014 var serialized = _serialize(port); 12014 var serialized = _serialize(port);
12015 localStorage['dart-port:$name'] = JSON.stringify(serialized); 12015 document.documentElement.attributes['dart-port:$name'] = JSON.stringify(seri alized);
12016 } 12016 }
12017 12017
12018 12018
12019 /** 12019 /**
12020 * @domName EventTarget.addEventListener, EventTarget.removeEventListener, Eve ntTarget.dispatchEvent 12020 * @domName EventTarget.addEventListener, EventTarget.removeEventListener, Eve ntTarget.dispatchEvent
12021 */ 12021 */
12022 LocalWindowEvents get on => 12022 LocalWindowEvents get on =>
12023 new LocalWindowEvents(this); 12023 new LocalWindowEvents(this);
12024 12024
12025 static const int PERSISTENT = 1; 12025 static const int PERSISTENT = 1;
(...skipping 13038 matching lines...) Expand 10 before | Expand all | Expand 10 after
25064 if (length < 0) throw new ArgumentError('length'); 25064 if (length < 0) throw new ArgumentError('length');
25065 if (start < 0) throw new RangeError.value(start); 25065 if (start < 0) throw new RangeError.value(start);
25066 int end = start + length; 25066 int end = start + length;
25067 if (end > a.length) throw new RangeError.value(end); 25067 if (end > a.length) throw new RangeError.value(end);
25068 for (int i = start; i < end; i++) { 25068 for (int i = start; i < end; i++) {
25069 accumulator.add(a[i]); 25069 accumulator.add(a[i]);
25070 } 25070 }
25071 return accumulator; 25071 return accumulator;
25072 } 25072 }
25073 } 25073 }
OLDNEW
« no previous file with comments | « client/dart.js ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698