Chromium Code Reviews| 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:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:async/async.dart'; | 9 import 'package:async/async.dart'; |
| 10 import 'package:json_rpc_2/json_rpc_2.dart' as rpc; | 10 import 'package:json_rpc_2/json_rpc_2.dart' as rpc; |
| 11 | 11 |
| 12 import 'breakpoint.dart'; | 12 import 'breakpoint.dart'; |
| 13 import 'error.dart'; | 13 import 'error.dart'; |
| 14 import 'exceptions.dart'; | 14 import 'exceptions.dart'; |
| 15 import 'library.dart'; | 15 import 'library.dart'; |
| 16 import 'pause_event.dart'; | 16 import 'pause_event.dart'; |
| 17 import 'scope.dart'; | 17 import 'scope.dart'; |
| 18 import 'sentinel.dart'; | 18 import 'sentinel.dart'; |
| 19 import 'source_report.dart'; | |
| 19 import 'stack.dart'; | 20 import 'stack.dart'; |
| 20 import 'stream_manager.dart'; | 21 import 'stream_manager.dart'; |
| 21 import 'utils.dart'; | 22 import 'utils.dart'; |
| 22 | 23 |
| 23 VMIsolateRef newVMIsolateRef(rpc.Peer peer, StreamManager streams, Map json) { | 24 VMIsolateRef newVMIsolateRef(rpc.Peer peer, StreamManager streams, Map json) { |
| 24 if (json == null) return null; | 25 if (json == null) return null; |
| 25 assert(json["type"] == "@Isolate" || json["type"] == "Isolate"); | 26 assert(json["type"] == "@Isolate" || json["type"] == "Isolate"); |
| 26 var scope = new Scope(peer, streams, json["id"]); | 27 var scope = new Scope(peer, streams, json["id"]); |
| 27 return new VMIsolateRef._(scope, json); | 28 return new VMIsolateRef._(scope, json); |
| 28 } | 29 } |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 /// | 336 /// |
| 336 /// This is supported as of VM service version 3.1, or Dart SDK version 1.14. | 337 /// This is supported as of VM service version 3.1, or Dart SDK version 1.14. |
| 337 Future<Object> invokeExtension(String method, [Map<String, String> params]) { | 338 Future<Object> invokeExtension(String method, [Map<String, String> params]) { |
| 338 if (!method.startsWith('ext.')) { | 339 if (!method.startsWith('ext.')) { |
| 339 throw new ArgumentError.value(method, 'method', | 340 throw new ArgumentError.value(method, 'method', |
| 340 'must begin with "ext." prefix'); | 341 'must begin with "ext." prefix'); |
| 341 } | 342 } |
| 342 return _scope.sendRequest(method, params); | 343 return _scope.sendRequest(method, params); |
| 343 } | 344 } |
| 344 | 345 |
| 346 /// Generates a set of reports tied to source locations in an isolate. | |
|
nweiz
2016/04/29 00:52:43
It's confusing that this says "a set of reports" b
kevmoo
2016/04/29 23:36:54
Acknowledged.
| |
| 347 /// | |
| 348 /// Set [includeCoverageReport] to `true` to include code coverage | |
| 349 /// information. | |
|
nweiz
2016/04/29 00:52:43
We don't usually talk about "setting" parameters.
kevmoo
2016/04/29 23:36:54
Done.
| |
| 350 /// | |
| 351 /// Set [includePossibleBreakpoints] to `true` to provide a list of token | |
| 352 /// positions which correspond to possible breakpoints. | |
|
nweiz
2016/04/29 00:52:43
"Provide" is usually refers to the caller providin
kevmoo
2016/04/29 23:36:54
Done.
| |
| 353 /// | |
| 354 /// Set [forceCompilation] to `true` to force compilation of all functions in | |
|
nweiz
2016/04/29 00:52:43
The parameter below is "forceCompile", not "forceC
kevmoo
2016/04/29 23:36:53
Done.
| |
| 355 /// the range of the report. | |
|
nweiz
2016/04/29 00:52:43
Nit: Don't add unnecessary newlines within paragra
kevmoo
2016/04/29 23:36:53
Done.
| |
| 356 /// Forcing compilation can cause a compilation error, which could terminate | |
| 357 /// the running Dart program. | |
|
nweiz
2016/04/29 00:52:43
Explain what the difference is between forcing com
kevmoo
2016/05/03 22:34:50
Done.
| |
| 358 Future<VMSourceReport> getSourceReport( | |
| 359 {bool includeCoverageReport, | |
| 360 bool includePossibleBreakpoints, | |
| 361 bool forceCompile}) async { | |
|
nweiz
2016/04/29 00:52:43
Give these default values and don't use "== true"
kevmoo
2016/04/29 23:36:54
Done.
| |
| 362 var reports = <String>[]; | |
| 363 if (includeCoverageReport == true) { | |
| 364 reports.add('Coverage'); | |
| 365 } | |
| 366 | |
| 367 if (includePossibleBreakpoints == true) { | |
| 368 reports.add('PossibleBreakpoints'); | |
| 369 } | |
| 370 | |
| 371 var params = <String, dynamic>{'reports': reports}; | |
|
nweiz
2016/04/29 00:52:43
This map literal has values, so it doesn't need to
kevmoo
2016/04/29 23:36:54
Done.
| |
| 372 | |
|
nweiz
2016/04/29 00:52:43
Nit: You probably don't need every line of code in
kevmoo
2016/04/29 23:36:54
Acknowledged.
| |
| 373 var json = await _scope.sendRequest('getSourceReport', params); | |
| 374 | |
| 375 return newSourceReport(_scope, json); | |
| 376 } | |
| 377 | |
| 345 bool operator ==(other) => other is VMIsolateRef && | 378 bool operator ==(other) => other is VMIsolateRef && |
| 346 other._scope.isolateId == _scope.isolateId; | 379 other._scope.isolateId == _scope.isolateId; |
| 347 | 380 |
| 348 int get hashCode => _scope.isolateId.hashCode; | 381 int get hashCode => _scope.isolateId.hashCode; |
| 349 | 382 |
| 350 String toString() => name; | 383 String toString() => name; |
| 351 } | 384 } |
| 352 | 385 |
| 353 /// A full isolate on the remote VM. | 386 /// A full isolate on the remote VM. |
| 354 class VMIsolate extends VMIsolateRef { | 387 class VMIsolate extends VMIsolateRef { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 /// The kind, which identifies the type of event and its source. | 494 /// The kind, which identifies the type of event and its source. |
| 462 final String kind; | 495 final String kind; |
| 463 | 496 |
| 464 /// The event's payload. | 497 /// The event's payload. |
| 465 final Map data; | 498 final Map data; |
| 466 | 499 |
| 467 VMExtensionEvent._(Map json) | 500 VMExtensionEvent._(Map json) |
| 468 : kind = json['extensionKind'], | 501 : kind = json['extensionKind'], |
| 469 data = json['extensionData']; | 502 data = json['extensionData']; |
| 470 } | 503 } |
| OLD | NEW |