| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of vmservice; | 5 part of vmservice; |
| 6 | 6 |
| 7 class Message { | 7 class Message { |
| 8 final Completer _completer = new Completer.sync(); | 8 final Completer _completer = new Completer.sync(); |
| 9 bool get completed => _completer.isCompleted; | 9 bool get completed => _completer.isCompleted; |
| 10 /// Future of response. | 10 /// Future of response. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 if (uri == null) { | 45 if (uri == null) { |
| 46 return ''; | 46 return ''; |
| 47 } | 47 } |
| 48 if (uri.pathSegments.length == 0) { | 48 if (uri.pathSegments.length == 0) { |
| 49 return ''; | 49 return ''; |
| 50 } | 50 } |
| 51 return uri.pathSegments[0]; | 51 return uri.pathSegments[0]; |
| 52 } | 52 } |
| 53 | 53 |
| 54 Message.fromUri(this.client, Uri uri) | 54 Message.fromUri(this.client, Uri uri) |
| 55 : method = _methodNameFromUri(uri) { | 55 : serial = '', method = _methodNameFromUri(uri) { |
| 56 params.addAll(uri.queryParameters); | 56 params.addAll(uri.queryParameters); |
| 57 } | 57 } |
| 58 | 58 |
| 59 Message.forIsolate(this.client, Uri uri, RunningIsolate isolate) | 59 Message.forIsolate(this.client, Uri uri, RunningIsolate isolate) |
| 60 : method = _methodNameFromUri(uri) { | 60 : serial = '', method = _methodNameFromUri(uri) { |
| 61 params.addAll(uri.queryParameters); | 61 params.addAll(uri.queryParameters); |
| 62 params['isolateId'] = isolate.serviceId; | 62 params['isolateId'] = isolate.serviceId; |
| 63 } | 63 } |
| 64 | 64 |
| 65 Uri toUri() { | 65 Uri toUri() { |
| 66 return new Uri(path: method, queryParameters: params); | 66 return new Uri(path: method, queryParameters: params); |
| 67 } | 67 } |
| 68 | 68 |
| 69 dynamic toJson() { | 69 dynamic toJson() { |
| 70 return { | 70 return { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 }; | 156 }; |
| 157 _completer.complete(JSON.encode(response)); | 157 _completer.complete(JSON.encode(response)); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool sendIsolateServiceMessage(SendPort sp, List m) | 161 bool sendIsolateServiceMessage(SendPort sp, List m) |
| 162 native "VMService_SendIsolateServiceMessage"; | 162 native "VMService_SendIsolateServiceMessage"; |
| 163 | 163 |
| 164 void sendRootServiceMessage(List m) | 164 void sendRootServiceMessage(List m) |
| 165 native "VMService_SendRootServiceMessage"; | 165 native "VMService_SendRootServiceMessage"; |
| OLD | NEW |