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

Unified Diff: dart/pkg/http_server/lib/src/virtual_directory.dart

Issue 171363006: pkg/http_server: return a Future on VirtualDirectory.serveFile Base URL: https://github.com/dart-lang/bleeding_edge.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/http_server/lib/src/virtual_directory.dart
diff --git a/dart/pkg/http_server/lib/src/virtual_directory.dart b/dart/pkg/http_server/lib/src/virtual_directory.dart
index 6eef0b4208b3811dee2e362d8612e4fd200bea9f..117c8f1da39cbe154a9b5ee18a3ee6bca5e4f86b 100644
--- a/dart/pkg/http_server/lib/src/virtual_directory.dart
+++ b/dart/pkg/http_server/lib/src/virtual_directory.dart
@@ -171,7 +171,7 @@ class VirtualDirectory {
* Note that if it was unabled to read from [file], the [request]s response
* is closed with error-code [HttpStatus.NOT_FOUND].
*/
- void serveFile(File file, HttpRequest request) {
+ Future serveFile(File file, HttpRequest request) {
var response = request.response;
// TODO(ajohnsen): Set up Zone support for these errors.
file.lastModified().then((lastModified) {
@@ -238,6 +238,8 @@ class VirtualDirectory {
response.statusCode = HttpStatus.NOT_FOUND;
response.close();
});
+
+ return response.done;
}
void _serveDirectory(Directory dir, HttpRequest request) {
« 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