| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:convert'; | 6 import 'dart:convert'; |
| 7 | 7 |
| 8 import 'package:async/async.dart'; | 8 import 'package:async/async.dart'; |
| 9 import 'package:json_rpc_2/json_rpc_2.dart' as rpc; | 9 import 'package:json_rpc_2/json_rpc_2.dart' as rpc; |
| 10 import 'package:stream_channel/stream_channel.dart'; | 10 import 'package:stream_channel/stream_channel.dart'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 export 'src/flag.dart' hide newVMFlagList; | 30 export 'src/flag.dart' hide newVMFlagList; |
| 31 export 'src/frame.dart' hide newVMFrame; | 31 export 'src/frame.dart' hide newVMFrame; |
| 32 export 'src/function.dart' hide newVMFunctionRef; | 32 export 'src/function.dart' hide newVMFunctionRef; |
| 33 export 'src/instance.dart' hide newVMInstanceRef, newVMInstance, | 33 export 'src/instance.dart' hide newVMInstanceRef, newVMInstance, |
| 34 newVMTypeLikeInstanceRef, newVMTypeInstanceRef, newVMInstanceRefOrSentinel; | 34 newVMTypeLikeInstanceRef, newVMTypeInstanceRef, newVMInstanceRefOrSentinel; |
| 35 export 'src/isolate.dart' hide newVMIsolateRef; | 35 export 'src/isolate.dart' hide newVMIsolateRef; |
| 36 export 'src/library.dart' hide newVMLibraryRef; | 36 export 'src/library.dart' hide newVMLibraryRef; |
| 37 export 'src/message.dart' hide newVMMessage; | 37 export 'src/message.dart' hide newVMMessage; |
| 38 export 'src/object.dart'; | 38 export 'src/object.dart'; |
| 39 export 'src/pause_event.dart' hide newVMPauseEvent; | 39 export 'src/pause_event.dart' hide newVMPauseEvent; |
| 40 export 'src/script.dart' hide newVMScriptRef, newVMScriptToken; | 40 export 'src/script.dart' hide newVMScriptRef, newVMScriptToken, |
| 41 newVMScriptTokenFromPosition; |
| 41 export 'src/sentinel.dart' hide newVMSentinel; | 42 export 'src/sentinel.dart' hide newVMSentinel; |
| 42 export 'src/service_version.dart' hide newVMServiceVersion; | 43 export 'src/service_version.dart' hide newVMServiceVersion; |
| 43 export 'src/source_location.dart' hide newVMSourceLocation; | 44 export 'src/source_location.dart' hide newVMSourceLocation, |
| 45 newVMSourceLocationFromPosition; |
| 46 export 'src/source_report.dart' hide newSourceReport; |
| 44 export 'src/stack.dart' hide newVMStack; | 47 export 'src/stack.dart' hide newVMStack; |
| 45 export 'src/type_arguments.dart' hide newVMTypeArgumentsRef; | 48 export 'src/type_arguments.dart' hide newVMTypeArgumentsRef; |
| 46 export 'src/unresolved_source_location.dart' hide newVMUnresolvedSourceLocation; | 49 export 'src/unresolved_source_location.dart' hide newVMUnresolvedSourceLocation; |
| 47 export 'src/vm.dart' hide newVM; | 50 export 'src/vm.dart' hide newVM; |
| 48 | 51 |
| 49 /// A [StreamSinkTransformer] that converts encodes JSON messages. | 52 /// A [StreamSinkTransformer] that converts encodes JSON messages. |
| 50 /// | 53 /// |
| 51 /// We can't use fromStreamTransformer with JSON.encoder because it isn't | 54 /// We can't use fromStreamTransformer with JSON.encoder because it isn't |
| 52 /// guaranteed to emit the entire object as a single message, and the WebSocket | 55 /// guaranteed to emit the entire object as a single message, and the WebSocket |
| 53 /// protocol cares about that. | 56 /// protocol cares about that. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 123 |
| 121 /// Creates a client that reads incoming messages from [incoming] and writes | 124 /// Creates a client that reads incoming messages from [incoming] and writes |
| 122 /// outgoing messages to [outgoing]. | 125 /// outgoing messages to [outgoing]. |
| 123 /// | 126 /// |
| 124 /// If [incoming] is a [StreamSink] as well as a [Stream] (for example, a | 127 /// If [incoming] is a [StreamSink] as well as a [Stream] (for example, a |
| 125 /// [WebSocket]), [outgoing] may be omitted. | 128 /// [WebSocket]), [outgoing] may be omitted. |
| 126 /// | 129 /// |
| 127 /// This is useful when using the client over a pre-existing connection. To | 130 /// This is useful when using the client over a pre-existing connection. To |
| 128 /// establish a connection from scratch, use [connect]. | 131 /// establish a connection from scratch, use [connect]. |
| 129 factory VMServiceClient(StreamChannel<String> channel) => | 132 factory VMServiceClient(StreamChannel<String> channel) => |
| 130 new VMServiceClient.withoutJson(channel.transform(jsonDocument)); | 133 new VMServiceClient.withoutJson(jsonDocument.bind(channel)); |
| 131 | 134 |
| 132 /// Creates a client that reads incoming decoded messages from [incoming] and | 135 /// Creates a client that reads incoming decoded messages from [incoming] and |
| 133 /// writes outgoing decoded messages to [outgoing]. | 136 /// writes outgoing decoded messages to [outgoing]. |
| 134 /// | 137 /// |
| 135 /// Unlike [new VMServiceClient], this doesn't read or write JSON strings. | 138 /// Unlike [new VMServiceClient], this doesn't read or write JSON strings. |
| 136 /// Instead, it reads and writes decoded maps. | 139 /// Instead, it reads and writes decoded maps. |
| 137 /// | 140 /// |
| 138 /// If [incoming] is a [StreamSink] as well as a [Stream], [outgoing] may be | 141 /// If [incoming] is a [StreamSink] as well as a [Stream], [outgoing] may be |
| 139 /// omitted. | 142 /// omitted. |
| 140 /// | 143 /// |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 /// via [VM.version]. Note also that this doesn't necessarily accurately | 208 /// via [VM.version]. Note also that this doesn't necessarily accurately |
| 206 /// reflect the available APIs; for example, VM service versions 3.1, 3.2, and | 209 /// reflect the available APIs; for example, VM service versions 3.1, 3.2, and |
| 207 /// 3.3 all reported themseves as version 3.0. | 210 /// 3.3 all reported themseves as version 3.0. |
| 208 Future<VMServiceVersion> getVersion() async => | 211 Future<VMServiceVersion> getVersion() async => |
| 209 newVMServiceVersion(await _peer.sendRequest("getVersion", {})); | 212 newVMServiceVersion(await _peer.sendRequest("getVersion", {})); |
| 210 | 213 |
| 211 /// Returns information about the Dart VM. | 214 /// Returns information about the Dart VM. |
| 212 Future<VM> getVM() async => | 215 Future<VM> getVM() async => |
| 213 newVM(_peer, _streams, await _peer.sendRequest("getVM", {})); | 216 newVM(_peer, _streams, await _peer.sendRequest("getVM", {})); |
| 214 } | 217 } |
| OLD | NEW |