OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 part of repositories; | 5 part of repositories; |
6 | 6 |
7 class HeapSnapshotLoadingProgressEvent | 7 class HeapSnapshotLoadingProgressEvent |
8 implements M.HeapSnapshotLoadingProgressEvent { | 8 implements M.HeapSnapshotLoadingProgressEvent { |
9 final HeapSnapshotLoadingProgress progress; | 9 final HeapSnapshotLoadingProgress progress; |
10 HeapSnapshotLoadingProgressEvent(this.progress); | 10 HeapSnapshotLoadingProgressEvent(this.progress); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 _onProgress = | 93 _onProgress = |
94 new StreamController<HeapSnapshotLoadingProgressEvent>.broadcast(); | 94 new StreamController<HeapSnapshotLoadingProgressEvent>.broadcast(); |
95 (() async { | 95 (() async { |
96 _triggerOnProgress(); | 96 _triggerOnProgress(); |
97 _onProgress.close(); | 97 _onProgress.close(); |
98 }()); | 98 }()); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 class HeapSnapshotRepository implements M.HeapSnapshotRepository { | 102 class HeapSnapshotRepository implements M.HeapSnapshotRepository { |
103 Stream<HeapSnapshotLoadingProgressEvent> get( | 103 Stream<HeapSnapshotLoadingProgressEvent> get(M.IsolateRef i, |
104 M.IsolateRef i, | 104 {M.HeapSnapshotRoots roots: M.HeapSnapshotRoots.vm, bool gc: false}) { |
105 {M.HeapSnapshotRoots roots: M.HeapSnapshotRoots.vm, | |
106 bool gc: false}) { | |
107 S.Isolate isolate = i as S.Isolate; | 105 S.Isolate isolate = i as S.Isolate; |
108 assert(isolate != null); | 106 assert(isolate != null); |
109 assert(gc != null); | 107 assert(gc != null); |
110 return new HeapSnapshotLoadingProgress(isolate, roots, gc).onProgress; | 108 return new HeapSnapshotLoadingProgress(isolate, roots, gc).onProgress; |
111 } | 109 } |
112 } | 110 } |
OLD | NEW |