| 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 library vmservice; | 5 library vmservice; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 import 'dart:typed_data'; | 10 import 'dart:typed_data'; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 // Request command line flags. | 255 // Request command line flags. |
| 256 var getFlagList = Uri.parse('getFlagList'); | 256 var getFlagList = Uri.parse('getFlagList'); |
| 257 var getFlagListResponse = JSON.decode( | 257 var getFlagListResponse = JSON.decode( |
| 258 await new Message.fromUri(client, getFlagList).sendToVM()); | 258 await new Message.fromUri(client, getFlagList).sendToVM()); |
| 259 responses[getFlagList.toString()] = getFlagListResponse['result']; | 259 responses[getFlagList.toString()] = getFlagListResponse['result']; |
| 260 | 260 |
| 261 // Make requests to each isolate. | 261 // Make requests to each isolate. |
| 262 for (var isolate in isolates) { | 262 for (var isolate in isolates) { |
| 263 for (var request in perIsolateRequests) { | 263 for (var request in perIsolateRequests) { |
| 264 var message = new Message.forIsolate(request, isolate); | 264 var message = new Message.forIsolate(client, request, isolate); |
| 265 // Decode the JSON and and insert it into the map. The map key | 265 // Decode the JSON and and insert it into the map. The map key |
| 266 // is the request Uri. | 266 // is the request Uri. |
| 267 var response = JSON.decode(await isolate.route(message)); | 267 var response = JSON.decode(await isolate.route(message)); |
| 268 responses[message.toUri().toString()] = response['result']; | 268 responses[message.toUri().toString()] = response['result']; |
| 269 } | 269 } |
| 270 // Dump the object id ring requests. | 270 // Dump the object id ring requests. |
| 271 var message = | 271 var message = |
| 272 new Message.forIsolate(client, Uri.parse('_dumpIdZone'), isolate); | 272 new Message.forIsolate(client, Uri.parse('_dumpIdZone'), isolate); |
| 273 var response = JSON.decode(await isolate.route(message)); | 273 var response = JSON.decode(await isolate.route(message)); |
| 274 // Insert getObject requests into responses map. | 274 // Insert getObject requests into responses map. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 service.runningIsolates.isolateStartup(port_id, sp, name); | 318 service.runningIsolates.isolateStartup(port_id, sp, name); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void _onStart() native "VMService_OnStart"; | 321 void _onStart() native "VMService_OnStart"; |
| 322 | 322 |
| 323 void _onExit() native "VMService_OnExit"; | 323 void _onExit() native "VMService_OnExit"; |
| 324 | 324 |
| 325 bool _vmListenStream(String streamId) native "VMService_ListenStream"; | 325 bool _vmListenStream(String streamId) native "VMService_ListenStream"; |
| 326 | 326 |
| 327 void _vmCancelStream(String streamId) native "VMService_CancelStream"; | 327 void _vmCancelStream(String streamId) native "VMService_CancelStream"; |
| OLD | NEW |