OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 service_common; | 5 library service_common; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 final WebSocketVMTarget target; | 84 final WebSocketVMTarget target; |
85 final Map<String, _WebSocketRequest> _delayedRequests = | 85 final Map<String, _WebSocketRequest> _delayedRequests = |
86 new Map<String, _WebSocketRequest>(); | 86 new Map<String, _WebSocketRequest>(); |
87 final Map<String, _WebSocketRequest> _pendingRequests = | 87 final Map<String, _WebSocketRequest> _pendingRequests = |
88 new Map<String, _WebSocketRequest>(); | 88 new Map<String, _WebSocketRequest>(); |
89 int _requestSerial = 0; | 89 int _requestSerial = 0; |
90 bool _hasInitiatedConnect = false; | 90 bool _hasInitiatedConnect = false; |
91 bool _hasFinishedConnect = false; | 91 bool _hasFinishedConnect = false; |
92 Utf8Decoder _utf8Decoder = const Utf8Decoder(); | 92 Utf8Decoder _utf8Decoder = const Utf8Decoder(); |
93 | 93 |
| 94 String get displayName => '${name}@${target.name}'; |
| 95 |
94 CommonWebSocket _webSocket; | 96 CommonWebSocket _webSocket; |
95 | 97 |
96 CommonWebSocketVM(this.target, this._webSocket) { | 98 CommonWebSocketVM(this.target, this._webSocket) { |
97 assert(target != null); | 99 assert(target != null); |
98 } | 100 } |
99 | 101 |
100 void _notifyConnect() { | 102 void _notifyConnect() { |
101 _hasFinishedConnect = true; | 103 _hasFinishedConnect = true; |
102 if (!_connected.isCompleted) { | 104 if (!_connected.isCompleted) { |
103 Logger.root.info('WebSocketVM connection opened: ${target.networkAddress}'
); | 105 Logger.root.info('WebSocketVM connection opened: ${target.networkAddress}'
); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 if (request.method != 'getTagProfile' && | 323 if (request.method != 'getTagProfile' && |
322 request.method != 'getIsolateMetric' && | 324 request.method != 'getIsolateMetric' && |
323 request.method != 'getVMMetric') { | 325 request.method != 'getVMMetric') { |
324 Logger.root.info( | 326 Logger.root.info( |
325 'GET [${serial}] ${request.method}(${request.params}) from ${target.ne
tworkAddress}'); | 327 'GET [${serial}] ${request.method}(${request.params}) from ${target.ne
tworkAddress}'); |
326 } | 328 } |
327 // Send message. | 329 // Send message. |
328 _webSocket.send(message); | 330 _webSocket.send(message); |
329 } | 331 } |
330 } | 332 } |
OLD | NEW |