Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: lib/src/isolate.dart

Issue 1929063002: pkg/vm_service_client: add getSourceReport to VMServiceReference (Closed) Base URL: https://github.com/dart-lang/vm_service_client.git@master
Patch Set: code review Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/script.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/isolate.dart
diff --git a/lib/src/isolate.dart b/lib/src/isolate.dart
index 53fa415941f91ec47958b5681d0c0d77349e8493..7f1fa5740a75616e12a6a2e7f068da2522efc567 100644
--- a/lib/src/isolate.dart
+++ b/lib/src/isolate.dart
@@ -16,6 +16,7 @@ import 'library.dart';
import 'pause_event.dart';
import 'scope.dart';
import 'sentinel.dart';
+import 'source_report.dart';
import 'stack.dart';
import 'stream_manager.dart';
import 'utils.dart';
@@ -342,6 +343,46 @@ class VMIsolateRef {
return _scope.sendRequest(method, params);
}
+ /// Generates a report of code coverage information and possible break points
+ /// for the scripts in this isolate.
+ ///
+ /// If [includeCoverageReport] is `true`, the report includes code coverage
+ /// information via [VMSourceReportRange.hits] and
+ /// [VMSourceReportRange.misses] in
+ /// [VMSourceReport.ranges].
+ /// Otherwise, [VMSourceReportRange.coverage] is `null`.
+ ///
+ /// If [includePossibleBreakpoints] is `true`, the report includes a list of
+ /// token positions which correspond to possible breakpoints via
+ /// [VMSourceReportRange.possibleBreakpoints] in [VMSourceReport.ranges].
+ /// Otherwise, [VMSourceReportRange.possibleBreakpoints] is `null`.
+ ///
+ /// If [forceCompile] is `true`, all functions in the range of the report
+ /// will be compiled.
+ /// Forcing compilation can cause a compilation error, which could terminate
+ /// the running Dart program.
kevmoo 2016/04/29 23:36:56 still need to do this...
kevmoo 2016/05/03 22:34:50 Done.
+ Future<VMSourceReport> getSourceReport(
+ {bool includeCoverageReport: false,
+ bool includePossibleBreakpoints: false,
+ bool forceCompile: false}) async {
+ var reports = <String>[];
+ if (includeCoverageReport) {
+ reports.add('Coverage');
+ }
+
+ if (includePossibleBreakpoints) {
+ reports.add('PossibleBreakpoints');
+ }
+
+ var params = {'reports': reports};
+ if (forceCompile) {
+ params['forceCompile'] = true;
+ }
+
+ var json = await _scope.sendRequest('getSourceReport', params);
+ return newSourceReport(_scope, json);
+ }
+
bool operator ==(other) => other is VMIsolateRef &&
other._scope.isolateId == _scope.isolateId;
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/script.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698