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 |
| 11 import 'package:observatory/models.dart' as M; |
| 12 |
11 import 'package:logging/logging.dart'; | 13 import 'package:logging/logging.dart'; |
12 import 'package:observatory/service.dart'; | 14 import 'package:observatory/service.dart'; |
13 | 15 |
14 // Export the service library. | 16 // Export the service library. |
15 export 'package:observatory/service.dart'; | 17 export 'package:observatory/service.dart'; |
16 | 18 |
17 /// Description of a VM target. | 19 /// Description of a VM target. |
18 class WebSocketVMTarget { | 20 class WebSocketVMTarget implements M.Target { |
19 // Last time this VM has been connected to. | 21 // Last time this VM has been connected to. |
20 int lastConnectionTime = 0; | 22 int lastConnectionTime = 0; |
21 bool get hasEverConnected => lastConnectionTime > 0; | 23 bool get hasEverConnected => lastConnectionTime > 0; |
22 | 24 |
23 // Chrome VM or standalone; | 25 // Chrome VM or standalone; |
24 bool chrome = false; | 26 bool chrome = false; |
25 bool get standalone => !chrome; | 27 bool get standalone => !chrome; |
26 | 28 |
27 // User defined name. | 29 // User defined name. |
28 String name; | 30 String name; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 if (request.method != 'getTagProfile' && | 322 if (request.method != 'getTagProfile' && |
321 request.method != 'getIsolateMetric' && | 323 request.method != 'getIsolateMetric' && |
322 request.method != 'getVMMetric') { | 324 request.method != 'getVMMetric') { |
323 Logger.root.info( | 325 Logger.root.info( |
324 'GET [${serial}] ${request.method}(${request.params}) from ${target.ne
tworkAddress}'); | 326 'GET [${serial}] ${request.method}(${request.params}) from ${target.ne
tworkAddress}'); |
325 } | 327 } |
326 // Send message. | 328 // Send message. |
327 _webSocket.send(message); | 329 _webSocket.send(message); |
328 } | 330 } |
329 } | 331 } |
OLD | NEW |