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

Unified Diff: runtime/observatory/lib/src/app/application.dart

Issue 2255613002: Converted Observatory heap-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Better sorting tests Created 4 years, 4 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/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');
« no previous file with comments | « runtime/observatory/lib/src/allocation_profile/allocation_profile.dart ('k') | runtime/observatory/lib/src/app/page.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698