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

Side by Side Diff: runtime/observatory/lib/src/elements/pc_descriptors_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 unified diff | Download patch
OLDNEW
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, PcDescriptorsRef;
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 PcDescriptorsRefElement extends HtmlElement implements Renderable {
14 static const tag = const Tag<PcDescriptorsRefElement>('pc-ref-wrapped');
15
16 RenderingScheduler<PcDescriptorsRefElement> _r;
17
18 Stream<RenderedEvent<PcDescriptorsRefElement>> get onRendered => _r.onRendered ;
Cutch 2016/08/15 23:27:08 80 column line limit
cbernaschina 2016/08/16 00:01:44 Done.
19
20 M.IsolateRef _isolate;
21 M.PcDescriptorsRef _descriptors;
22
23 M.IsolateRef get isolate => _isolate;
24 M.PcDescriptorsRef get descriptors => _descriptors;
25
26 factory PcDescriptorsRefElement(M.IsolateRef isolate,
27 M.PcDescriptorsRef descriptors, {RenderingQueue queue}) {
28 assert(isolate != null);
29 assert(descriptors != null);
30 PcDescriptorsRefElement e = document.createElement(tag.name);
31 e._r = new RenderingScheduler(e, queue: queue);
32 e._isolate = isolate;
33 e._descriptors = descriptors;
34 return e;
35 }
36
37 PcDescriptorsRefElement.created() : super.created();
38
39 @override
40 void attached() {
41 super.attached();
42 _r.enable();
43 }
44
45 @override
46 void detached() {
47 super.detached();
48 _r.disable(notify: true);
49 children = [];
50 }
51
52 void render() {
53 final text = (_descriptors.name == null || _descriptors.name == '')
54 ? 'PcDescriptors'
55 : _descriptors.name;
56 children = [
57 new AnchorElement(href: Uris.inspect(_isolate, object: _descriptors))
58 ..text = text
59 ];
60 }
61 }
62
63
64 /*
Cutch 2016/08/15 23:27:08 delete dead code
cbernaschina 2016/08/16 00:01:44 Done.
6 <polymer-element name="object-ref"> 65 <polymer-element name="object-ref">
7 <template><link rel="stylesheet" href="css/shared.css"> 66 <template><link rel="stylesheet" href="css/shared.css">
8 67
9 <template if="{{ ref.isObjectPool }}"> 68 <template if="{{ ref.isObjectPool }}">
10 <a on-click="{{ goto }}" _href="{{ url }}"> 69 <a on-click="{{ goto }}" _href="{{ url }}">
11 <em>{{ ref.vmType }}</em> ({{ ref.length }}) 70 <em>{{ ref.vmType }}</em> ({{ ref.length }})
12 </a> 71 </a>
13 <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}"> 72 <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}">
14 <template if="{{ expanded }}"> 73 <template if="{{ expanded }}">
15 <div class="indented"> 74 <div class="indented">
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 <template if="{{ !(ref.isObjectPool || ref.isICData || ref.isMegamorphicCach e || ref.isInstructions) }}"> 106 <template if="{{ !(ref.isObjectPool || ref.isICData || ref.isMegamorphicCach e || ref.isInstructions) }}">
48 <template if="{{ nameIsEmpty }}"> 107 <template if="{{ nameIsEmpty }}">
49 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.vmType }}</em></a> 108 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.vmType }}</em></a>
50 </template> 109 </template>
51 <template if="{{ !nameIsEmpty }}"> 110 <template if="{{ !nameIsEmpty }}">
52 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ name }}</em></a> 111 <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ name }}</em></a>
53 </template> 112 </template>
54 </template> 113 </template>
55 </template> 114 </template>
56 </polymer-element> 115 </polymer-element>
57 116 */
58 <script type="application/dart" src="service_ref.dart"></script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698