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

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

Issue 2244433003: Converted Observatory refs elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: All element tested 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/elements/megamorphiccache_ref.dart
diff --git a/runtime/observatory/lib/src/elements/service_ref.html b/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart
similarity index 52%
copy from runtime/observatory/lib/src/elements/service_ref.html
copy to runtime/observatory/lib/src/elements/megamorphiccache_ref.dart
index c6e8b8b77960795d1be5b111b8eb31bed700343c..e1089a5a67a1ee609125a91ceaa1c1ff6db86957 100644
--- a/runtime/observatory/lib/src/elements/service_ref.html
+++ b/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart
@@ -1,8 +1,69 @@
-<link rel="import" href="../../../../packages/polymer/polymer.html">
+// Copyright (c) 2013, 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.
-<polymer-element name="any-service-ref">
-</polymer-element>
+import 'dart:html';
+import 'dart:async';
+import 'package:observatory/models.dart' as M
+ show IsolateRef, MegamorphicCacheRef;
+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 MegamorphicCacheRefElement extends HtmlElement implements Renderable {
+ static const tag =
+ const Tag<MegamorphicCacheRefElement>('megamorphic-cache-ref-wrapped');
+
+ RenderingScheduler<MegamorphicCacheRefElement> _r;
+
+ Stream<RenderedEvent<MegamorphicCacheRefElement>> get onRendered => _r.onRendered;
Cutch 2016/08/15 23:27:08 80 column line limit
cbernaschina 2016/08/16 00:01:43 Done.
+
+ M.IsolateRef _isolate;
+ M.MegamorphicCacheRef _cache;
+
+ M.IsolateRef get isolate => _isolate;
+ M.MegamorphicCacheRef get cache => _cache;
+
+ factory MegamorphicCacheRefElement(M.IsolateRef isolate,
+ M.MegamorphicCacheRef cache, {RenderingQueue queue}) {
+ assert(isolate != null);
+ assert(cache != null);
+ MegamorphicCacheRefElement e = document.createElement(tag.name);
+ e._r = new RenderingScheduler(e, queue: queue);
+ e._isolate = isolate;
+ e._cache = cache;
+ return e;
+ }
+ MegamorphicCacheRefElement.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: _cache))
+ ..children = [
+ new SpanElement()..classes = ['emphatize']
+ ..text = 'MegarmorphicCache',
+ new SpanElement()..text = ' (${_cache.selector})'
+ ]
+ ];
+ }
+}
+
+
+/*
<polymer-element name="object-ref">
Cutch 2016/08/15 23:27:08 delete dead code.
cbernaschina 2016/08/16 00:01:43 Done.
<template><link rel="stylesheet" href="css/shared.css">
@@ -54,5 +115,4 @@
</template>
</template>
</polymer-element>
-
-<script type="application/dart" src="service_ref.dart"></script>
+*/

Powered by Google App Engine
This is Rietveld 408576698