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

Unified Diff: runtime/bin/vmservice/client/lib/src/observatory/isolate.dart

Issue 143973005: Code coverage in Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
Index: runtime/bin/vmservice/client/lib/src/observatory/isolate.dart
diff --git a/runtime/bin/vmservice/client/lib/src/observatory/isolate.dart b/runtime/bin/vmservice/client/lib/src/observatory/isolate.dart
index 2117d8319cf75dbb8b2fba4a073aa233bb716832..babca7d8408357746ba2d8bc3465c55bcea38bb3 100644
--- a/runtime/bin/vmservice/client/lib/src/observatory/isolate.dart
+++ b/runtime/bin/vmservice/client/lib/src/observatory/isolate.dart
@@ -7,11 +7,11 @@ part of observatory;
/// State for a running isolate.
class Isolate extends Observable {
@observable Profile profile;
+ @observable final Map<String, Script> scripts =
+ toObservable(new Map<String, Script>());
@observable final List<Code> codes = new List<Code>();
@observable String id;
@observable String name;
- @observable final Map<String, ScriptSource> scripts =
- toObservable(new Map<String, ScriptSource>());
Isolate(this.id, this.name);
@@ -39,4 +39,17 @@ class Isolate extends Observable {
codes[i].resetTicks();
}
}
+
+ void updateCoverage(List coverages) {
+ for (var coverage in coverages) {
+ var id = coverage['script']['id'];
+ var script = scripts[id];
+ if (script == null) {
+ script = new Script.fromMap(coverage['script']);
+ scripts[id] = script;
+ }
+ assert(script != null);
+ script._processCoverageHits(coverage['hits']);
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698