| Index: runtime/observatory/lib/src/app/application.dart
|
| diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
|
| index d72994d49dd963e55382f5643ccf0f08e217c5a7..3ab1142e73114a9491b5799a5a7c827d4812b878 100644
|
| --- a/runtime/observatory/lib/src/app/application.dart
|
| +++ b/runtime/observatory/lib/src/app/application.dart
|
| @@ -25,6 +25,7 @@ class ObservatoryApplication extends Observable {
|
| return;
|
| }
|
| if (_vm != null) {
|
| + _gcSubscription = null;
|
| // Disconnect from current VM.
|
| notifications.deleteAll();
|
| _vm.disconnect();
|
| @@ -51,6 +52,25 @@ class ObservatoryApplication extends Observable {
|
| }
|
| _vm = vm;
|
| }
|
| +
|
| + StreamSubscription _gcSubscription;
|
| +
|
| + Future startGCEventListener() async {
|
| + if (_gcSubscription != null || _vm == null) {
|
| + return;
|
| + }
|
| + _gcSubscription = await _vm.listenEventStream(VM.kGCStream, _onEvent);
|
| + }
|
| +
|
| + Future stopGCEventListener() async {
|
| + if (_gcSubscription == null) {
|
| + return;
|
| + }
|
| + _gcSubscription.cancel();
|
| + _gcSubscription = null;
|
| + }
|
| +
|
| +
|
| @reflectable final ObservatoryApplicationElement rootElement;
|
|
|
| TraceViewElement _traceView = null;
|
| @@ -138,6 +158,9 @@ class ObservatoryApplication extends Observable {
|
| e = new InspectEvent(event.timestamp, event.isolate,
|
| event.inspectee);
|
| break;
|
| + case ServiceEvent.kGC:
|
| + e = new GCEvent(event.timestamp, event.isolate);
|
| + break;
|
| default:
|
| // Ignore unrecognized events.
|
| Logger.root.severe('Unrecognized event: $event');
|
|
|