Chromium Code Reviews| Index: runtime/observatory/lib/src/elements/heap_profile.dart |
| diff --git a/runtime/observatory/lib/src/elements/heap_profile.dart b/runtime/observatory/lib/src/elements/heap_profile.dart |
| index 243be472292053a783a23501a0143bf087f59edb..30198cc88ff265bfb81683257f2be93ed7fd17e8 100644 |
| --- a/runtime/observatory/lib/src/elements/heap_profile.dart |
| +++ b/runtime/observatory/lib/src/elements/heap_profile.dart |
| @@ -43,7 +43,7 @@ class HeapProfileElement extends ObservatoryElement { |
| var _classTableBody; |
| @published bool autoRefresh = false; |
| - var _subscription; |
| + var _subscriptionFuture; |
| @published Isolate isolate; |
| @observable ServiceMap profile; |
| @@ -93,13 +93,14 @@ class HeapProfileElement extends ObservatoryElement { |
| _oldPieChart = new Chart('PieChart', |
| shadowRoot.querySelector('#oldPieChart')); |
| _classTableBody = shadowRoot.querySelector('#classTableBody'); |
| - _subscription = app.vm.events.stream.where( |
| - (event) => event.isolate == isolate).listen(_onEvent); |
| + _subscriptionFuture = app.vm.getGCEventStream().then((stream) { |
|
Cutch
2015/07/07 23:16:09
This looks like the code in the previous file. Can
turnidge
2015/07/08 20:23:39
Done.
|
| + return stream.listen(_onEvent); |
| + }); |
| } |
| @override |
| void detached() { |
| - _subscription.cancel(); |
| + _subscriptionFuture.then((subscription) => subscription.cancel()); |
|
Cutch
2015/07/07 23:16:09
ditto?
void cancelFutureSubscription(Future<Strea
turnidge
2015/07/08 20:23:39
Done.
|
| super.detached(); |
| } |
| @@ -108,7 +109,8 @@ class HeapProfileElement extends ObservatoryElement { |
| bool refreshAutoQueued = false; |
| void _onEvent(ServiceEvent event) { |
| - if (autoRefresh && event.kind == 'GC') { |
| + assert(event.kind == 'GC'); |
| + if (autoRefresh) { |
| if (!refreshAutoPending) { |
| refreshAuto(); |
| } else { |