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

Unified Diff: lib/src/server/server.dart

Issue 1266483003: format with dart_style 0.2.0-rc.3 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « lib/src/server/dependency_graph.dart ('k') | lib/src/summary.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/server/server.dart
diff --git a/lib/src/server/server.dart b/lib/src/server/server.dart
index b297a88bdbe85255b4968c1fa359db65108d7b58..31d3a64a6515f2662a77efe9fbd8160c5a2876a0 100644
--- a/lib/src/server/server.dart
+++ b/lib/src/server/server.dart
@@ -261,26 +261,26 @@ class DevServer {
}
shelf.Handler rebuildAndCache(shelf.Handler handler) => (request) {
- print('requested $GREEN_COLOR${request.url}$NO_COLOR');
- // Trigger recompile only when requesting the HTML page.
- var segments = request.url.pathSegments;
- bool isEntryPage = segments.length == 0 || segments[0] == _entryPath;
- if (isEntryPage) compiler._runAgain();
-
- // To help browsers cache resources that don't change, we serve these
- // resources by adding a query parameter containing their hash:
- // /{path-to-file.js}?____cached={hash}
- var hash = request.url.queryParameters['____cached'];
- var response = handler(request);
- var policy = hash != null ? 'max-age=${24 * 60 * 60}' : 'no-cache';
- var headers = {'cache-control': policy};
- if (hash != null) {
- // Note: the cache-control header should be enough, but this doesn't hurt
- // and can help renew the policy after it expires.
- headers['ETag'] = hash;
- }
- return response.change(headers: headers);
- };
+ print('requested $GREEN_COLOR${request.url}$NO_COLOR');
+ // Trigger recompile only when requesting the HTML page.
+ var segments = request.url.pathSegments;
+ bool isEntryPage = segments.length == 0 || segments[0] == _entryPath;
+ if (isEntryPage) compiler._runAgain();
+
+ // To help browsers cache resources that don't change, we serve these
+ // resources by adding a query parameter containing their hash:
+ // /{path-to-file.js}?____cached={hash}
+ var hash = request.url.queryParameters['____cached'];
+ var response = handler(request);
+ var policy = hash != null ? 'max-age=${24 * 60 * 60}' : 'no-cache';
+ var headers = {'cache-control': policy};
+ if (hash != null) {
+ // Note: the cache-control header should be enough, but this doesn't
+ // hurt and can help renew the policy after it expires.
+ headers['ETag'] = hash;
+ }
+ return response.change(headers: headers);
+ };
}
UriResolver _createImplicitEntryResolver(String entryPath) {
@@ -303,6 +303,7 @@ class _ExistingSourceUriResolver implements UriResolver {
var src = resolver.resolveAbsolute(uri, actualUri);
return src.exists() ? src : null;
}
+
Uri restoreAbsolute(Source source) => resolver.restoreAbsolute(source);
}
« no previous file with comments | « lib/src/server/dependency_graph.dart ('k') | lib/src/summary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698