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

Unified Diff: runtime/observatory/lib/src/elements/subtypetestcache_ref.dart

Issue 2742333007: Add Observatory support for UnlinkedCall, SingleTargetCache and SubtypeTestCache. (Closed)
Patch Set: . Created 3 years, 9 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/subtypetestcache_ref.dart
diff --git a/runtime/observatory/lib/src/elements/subtypetestcache_ref.dart b/runtime/observatory/lib/src/elements/subtypetestcache_ref.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9dbde53bcda0ac94a9a48e0ac5ac8117da85847d
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/subtypetestcache_ref.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:html';
+import 'dart:async';
+import 'package:observatory/models.dart' as M
+ show IsolateRef, SubtypeTestCacheRef;
+import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
+import 'package:observatory/src/elements/helpers/tag.dart';
+import 'package:observatory/src/elements/helpers/uris.dart';
+
+class SubtypeTestCacheRefElement extends HtmlElement implements Renderable {
+ static const tag =
+ const Tag<SubtypeTestCacheRefElement>('subtypetestcache-ref');
+
+ RenderingScheduler<SubtypeTestCacheRefElement> _r;
+
+ Stream<RenderedEvent<SubtypeTestCacheRefElement>> get onRendered =>
+ _r.onRendered;
+
+ M.IsolateRef _isolate;
+ M.SubtypeTestCacheRef _subtypeTestCache;
+
+ M.IsolateRef get isolate => _isolate;
+ M.SubtypeTestCacheRef get subtypeTestCache => _subtypeTestCache;
+
+ factory SubtypeTestCacheRefElement(
+ M.IsolateRef isolate, M.SubtypeTestCacheRef subtypeTestCache,
+ {RenderingQueue queue}) {
+ assert(isolate != null);
+ assert(subtypeTestCache != null);
+ SubtypeTestCacheRefElement e = document.createElement(tag.name);
+ e._r = new RenderingScheduler(e, queue: queue);
+ e._isolate = isolate;
+ e._subtypeTestCache = subtypeTestCache;
+ return e;
+ }
+
+ SubtypeTestCacheRefElement.created() : super.created();
+
+ @override
+ void attached() {
+ super.attached();
+ _r.enable();
+ }
+
+ @override
+ void detached() {
+ super.detached();
+ _r.disable(notify: true);
+ children = [];
+ }
+
+ void render() {
+ children = [
+ new AnchorElement(href: Uris.inspect(_isolate, object: _subtypeTestCache))
+ ..children = [
+ new SpanElement()
+ ..classes = ['emphasize']
+ ..text = 'SubtypeTestCache',
+ ]
+ ];
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698