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

Unified Diff: runtime/observatory/lib/src/elements/isolate/shared_summary.dart

Issue 2304463002: Converted Observatory vm-view && isolate-view elements (Closed)
Patch Set: Fixed typo Created 4 years, 3 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/elements/isolate/shared_summary.dart
diff --git a/runtime/observatory/lib/src/elements/isolate/shared_summary.dart b/runtime/observatory/lib/src/elements/isolate/shared_summary.dart
index 1bf29147bd2847f94a575b5ad6a8cced0a9c1283..6bba9ed652808466755ca81103a62d61b74c3865 100644
--- a/runtime/observatory/lib/src/elements/isolate/shared_summary.dart
+++ b/runtime/observatory/lib/src/elements/isolate/shared_summary.dart
@@ -13,7 +13,7 @@ import 'package:observatory/src/elements/isolate/counter_chart.dart';
class IsolateSharedSummaryElement extends HtmlElement implements Renderable {
static const tag =
- const Tag<IsolateSharedSummaryElement>('isolate-shared-summary-wrapped',
+ const Tag<IsolateSharedSummaryElement>('isolate-shared-summary',
dependencies: const [
IsolateCounterChartElement.tag
]);
@@ -24,13 +24,18 @@ class IsolateSharedSummaryElement extends HtmlElement implements Renderable {
_r.onRendered;
M.Isolate _isolate;
+ M.EventRepository _events;
+ StreamSubscription _isolateSubscription;
factory IsolateSharedSummaryElement(M.Isolate isolate,
+ M.EventRepository events,
{RenderingQueue queue}) {
assert(isolate != null);
+ assert(events != null);
IsolateSharedSummaryElement e = document.createElement(tag.name);
e._r = new RenderingScheduler(e, queue: queue);
e._isolate = isolate;
+ e._events = events;
return e;
}
@@ -40,6 +45,7 @@ class IsolateSharedSummaryElement extends HtmlElement implements Renderable {
void attached() {
super.attached();
_r.enable();
+ _isolateSubscription = _events.onIsolateEvent.listen(_eventListener);
}
@override
@@ -47,6 +53,7 @@ class IsolateSharedSummaryElement extends HtmlElement implements Renderable {
super.detached();
children = [];
_r.disable(notify: true);
+ _isolateSubscription.cancel();
}
void render() {
@@ -158,4 +165,11 @@ class IsolateSharedSummaryElement extends HtmlElement implements Renderable {
];
}
}
+
+ void _eventListener(e) {
+ if (e.isolate.id == _isolate.id) {
+ _isolate = e.isolate;
+ _r.dirty();
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698