Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <link rel="import" href="../../../../packages/polymer/polymer.html"> | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 2 | 4 |
| 3 <polymer-element name="any-service-ref"> | 5 import 'dart:html'; |
| 4 </polymer-element> | 6 import 'dart:async'; |
| 7 import 'package:observatory/models.dart' as M | |
| 8 show IsolateRef, MegamorphicCacheRef; | |
| 9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | |
| 10 import 'package:observatory/src/elements/helpers/tag.dart'; | |
| 11 import 'package:observatory/src/elements/helpers/uris.dart'; | |
| 5 | 12 |
| 13 class MegamorphicCacheRefElement extends HtmlElement implements Renderable { | |
| 14 static const tag = | |
| 15 const Tag<MegamorphicCacheRefElement>('megamorphic-cache-ref-wrapped'); | |
| 16 | |
| 17 RenderingScheduler<MegamorphicCacheRefElement> _r; | |
| 18 | |
| 19 Stream<RenderedEvent<MegamorphicCacheRefElement>> get onRendered => _r.onRende red; | |
|
Cutch
2016/08/15 23:27:08
80 column line limit
cbernaschina
2016/08/16 00:01:43
Done.
| |
| 20 | |
| 21 M.IsolateRef _isolate; | |
| 22 M.MegamorphicCacheRef _cache; | |
| 23 | |
| 24 M.IsolateRef get isolate => _isolate; | |
| 25 M.MegamorphicCacheRef get cache => _cache; | |
| 26 | |
| 27 factory MegamorphicCacheRefElement(M.IsolateRef isolate, | |
| 28 M.MegamorphicCacheRef cache, {RenderingQueue queue}) { | |
| 29 assert(isolate != null); | |
| 30 assert(cache != null); | |
| 31 MegamorphicCacheRefElement e = document.createElement(tag.name); | |
| 32 e._r = new RenderingScheduler(e, queue: queue); | |
| 33 e._isolate = isolate; | |
| 34 e._cache = cache; | |
| 35 return e; | |
| 36 } | |
| 37 | |
| 38 MegamorphicCacheRefElement.created() : super.created(); | |
| 39 | |
| 40 @override | |
| 41 void attached() { | |
| 42 super.attached(); | |
| 43 _r.enable(); | |
| 44 } | |
| 45 | |
| 46 @override | |
| 47 void detached() { | |
| 48 super.detached(); | |
| 49 _r.disable(notify: true); | |
| 50 children = []; | |
| 51 } | |
| 52 | |
| 53 void render() { | |
| 54 children = [ | |
| 55 new AnchorElement(href: Uris.inspect(_isolate, object: _cache)) | |
| 56 ..children = [ | |
| 57 new SpanElement()..classes = ['emphatize'] | |
| 58 ..text = 'MegarmorphicCache', | |
| 59 new SpanElement()..text = ' (${_cache.selector})' | |
| 60 ] | |
| 61 ]; | |
| 62 } | |
| 63 } | |
| 64 | |
| 65 | |
| 66 /* | |
| 6 <polymer-element name="object-ref"> | 67 <polymer-element name="object-ref"> |
|
Cutch
2016/08/15 23:27:08
delete dead code.
cbernaschina
2016/08/16 00:01:43
Done.
| |
| 7 <template><link rel="stylesheet" href="css/shared.css"> | 68 <template><link rel="stylesheet" href="css/shared.css"> |
| 8 | 69 |
| 9 <template if="{{ ref.isObjectPool }}"> | 70 <template if="{{ ref.isObjectPool }}"> |
| 10 <a on-click="{{ goto }}" _href="{{ url }}"> | 71 <a on-click="{{ goto }}" _href="{{ url }}"> |
| 11 <em>{{ ref.vmType }}</em> ({{ ref.length }}) | 72 <em>{{ ref.vmType }}</em> ({{ ref.length }}) |
| 12 </a> | 73 </a> |
| 13 <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}"> | 74 <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}"> |
| 14 <template if="{{ expanded }}"> | 75 <template if="{{ expanded }}"> |
| 15 <div class="indented"> | 76 <div class="indented"> |
| 16 <template repeat="{{ entry in ref.entries }}"> | 77 <template repeat="{{ entry in ref.entries }}"> |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 47 <template if="{{ !(ref.isObjectPool || ref.isICData || ref.isMegamorphicCach e || ref.isInstructions) }}"> | 108 <template if="{{ !(ref.isObjectPool || ref.isICData || ref.isMegamorphicCach e || ref.isInstructions) }}"> |
| 48 <template if="{{ nameIsEmpty }}"> | 109 <template if="{{ nameIsEmpty }}"> |
| 49 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.vmType }}</em></a> | 110 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.vmType }}</em></a> |
| 50 </template> | 111 </template> |
| 51 <template if="{{ !nameIsEmpty }}"> | 112 <template if="{{ !nameIsEmpty }}"> |
| 52 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ name }}</em></a> | 113 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ name }}</em></a> |
| 53 </template> | 114 </template> |
| 54 </template> | 115 </template> |
| 55 </template> | 116 </template> |
| 56 </polymer-element> | 117 </polymer-element> |
| 57 | 118 */ |
| 58 <script type="application/dart" src="service_ref.dart"></script> | |
| OLD | NEW |