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

Side by Side Diff: samples/leap/request_cache.dart

Issue 11085017: Move leap to lib/compiler/samples. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/leap/leap_server.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #library('request_cache');
6
7 #import('dart:html');
8
9 /** File system implementation using HTML5's Web Storage. */
10 class HttpRequestCache {
11 final Storage storage;
12
13 HttpRequestCache() : storage = window.sessionStorage;
14
15 String readAll(String filename) {
16 String response = storage[filename];
17
18 if (response == null) {
19 HttpRequest xr = new HttpRequest();
20 xr.open("GET", filename, false);
21 xr.send();
22 response = xr.responseText;
23 storage[filename] = response;
24 }
25 return response;
26 }
27 }
OLDNEW
« no previous file with comments | « samples/leap/leap_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698