| Index: runtime/bin/vmservice/vmservice_dartium.dart
|
| diff --git a/runtime/bin/vmservice/vmservice_dartium.dart b/runtime/bin/vmservice/vmservice_dartium.dart
|
| index 249455dd9bb85e6996705e2f1488957a2d237e1f..a05d1187d940b202697115543365783b27623b78 100644
|
| --- a/runtime/bin/vmservice/vmservice_dartium.dart
|
| +++ b/runtime/bin/vmservice/vmservice_dartium.dart
|
| @@ -15,20 +15,18 @@ RawReceivePort _requestPort;
|
| // The native method that is called to post the response back to DevTools.
|
| void postResponse(String response, int cookie) native "VMService_PostResponse";
|
|
|
| -void handleRequest(service, String uri, cookie) {
|
| - var serviceRequest = new ServiceRequest();
|
| - var r = serviceRequest.parse(Uri.parse(uri));
|
| - if (r) {
|
| - var f = service.runningIsolates.route(serviceRequest);
|
| - assert(f != null);
|
| - f.then((_) {
|
| - postResponse(serviceRequest.response, cookie);
|
| - }).catchError((e) {
|
| +void handleMessage(service, uri, cookie) {
|
| + var message = new Message.fromUri(uri);
|
| + var client = new HttpRequestClient(request, service);
|
| + message.future.then((response) {
|
| + try {
|
| + postResponse(response, cookie);
|
| + } catch (_) {
|
| // Error posting response back to Dartium.
|
| - });
|
| - return;
|
| - }
|
| - postResponse(serviceRequest.response, cookie);
|
| + }
|
| + });
|
| + // Send message for processing.
|
| + service.route(message);
|
| }
|
|
|
| main() {
|
| @@ -45,11 +43,11 @@ main() {
|
| if (message.length != 2) {
|
| return;
|
| }
|
| - var uri = message[0];
|
| - if (uri is! String) {
|
| + if (message[0] is! String) {
|
| return;
|
| }
|
| + var uri = Uri.parse(message[0]);
|
| var cookie = message[1];
|
| - handleRequest(service, uri, cookie);
|
| + handleMessage(service, uri, cookie);
|
| });
|
| }
|
|
|