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

Unified Diff: runtime/bin/vmservice/server.dart

Issue 19870006: Support stacktrace and objecthistogram service commands (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: runtime/bin/vmservice/server.dart
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index cf603f3a041a65121d2b636929271b75c728c445..a52677c4d8f826d742b36b834cd38b1f13385c01 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -30,21 +30,31 @@ class Server {
var serviceRequest = new ServiceRequest();
var r = serviceRequest.parse(request.uri);
+ var f;
if (!r) {
// Did not understand the request uri.
serviceRequest.setErrorResponse('Invalid request uri: ${request.uri}');
} else {
- r = service.runningIsolates.route(serviceRequest);
- if (!r) {
- // Nothing responds to this type of request.
- serviceRequest.setErrorResponse('No route for: $path');
- }
+ f = service.runningIsolates.route(serviceRequest);
+ }
+
+ if (f == null) {
+ // Nothing responds to this type of request.
+ serviceRequest.setErrorResponse('No route for: $path');
siva 2013/08/01 18:16:18 This seems to override the error response set in t
Cutch 2013/08/01 22:22:04 Done.
+ // Send response back over HTTP.
+ request.response.headers.contentType = jsonContentType;
+ request.response.write(serviceRequest.response);
+ request.response.close();
+ return;
}
- // Send response back over HTTP.
- request.response.headers.contentType = jsonContentType;
- request.response.write(serviceRequest.response);
- request.response.close();
+ // Route was successful.
+ f.then((_) {
+ // Send response back over HTTP.
+ request.response.headers.contentType = jsonContentType;
+ request.response.write(serviceRequest.response);
+ request.response.close();
+ });
}
Future startServer() {
@@ -62,4 +72,3 @@ class Server {
});
}
}
-

Powered by Google App Engine
This is Rietveld 408576698