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

Side by Side Diff: runtime/observatory/lib/src/elements/code_ref.dart

Issue 2773073003: Revert "Added page to Observatory to display native memory allocation information." (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library code_ref_element; 5 library code_ref_element;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'dart:async'; 8 import 'dart:async';
9 import 'package:observatory/models.dart' as M 9 import 'package:observatory/models.dart' as M
10 show IsolateRef, CodeRef, isSyntheticCode; 10 show IsolateRef, CodeRef, isSyntheticCode;
11 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; 11 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
12 import 'package:observatory/src/elements/helpers/tag.dart'; 12 import 'package:observatory/src/elements/helpers/tag.dart';
13 import 'package:observatory/src/elements/helpers/uris.dart'; 13 import 'package:observatory/src/elements/helpers/uris.dart';
14 14
15 class CodeRefElement extends HtmlElement implements Renderable { 15 class CodeRefElement extends HtmlElement implements Renderable {
16 static const tag = const Tag<CodeRefElement>('code-ref'); 16 static const tag = const Tag<CodeRefElement>('code-ref');
17 17
18 RenderingScheduler<CodeRefElement> _r; 18 RenderingScheduler<CodeRefElement> _r;
19 19
20 Stream<RenderedEvent<CodeRefElement>> get onRendered => _r.onRendered; 20 Stream<RenderedEvent<CodeRefElement>> get onRendered => _r.onRendered;
21 21
22 M.IsolateRef _isolate; 22 M.IsolateRef _isolate;
23 M.CodeRef _code; 23 M.CodeRef _code;
24 24
25 M.IsolateRef get isolate => _isolate; 25 M.IsolateRef get isolate => _isolate;
26 M.CodeRef get code => _code; 26 M.CodeRef get code => _code;
27 27
28 factory CodeRefElement(M.IsolateRef isolate, M.CodeRef code, 28 factory CodeRefElement(M.IsolateRef isolate, M.CodeRef code,
29 {RenderingQueue queue}) { 29 {RenderingQueue queue}) {
30 assert(isolate != null);
30 assert(code != null); 31 assert(code != null);
31 CodeRefElement e = document.createElement(tag.name); 32 CodeRefElement e = document.createElement(tag.name);
32 e._r = new RenderingScheduler(e, queue: queue); 33 e._r = new RenderingScheduler(e, queue: queue);
33 e._isolate = isolate; 34 e._isolate = isolate;
34 e._code = code; 35 e._code = code;
35 return e; 36 return e;
36 } 37 }
37 38
38 CodeRefElement.created() : super.created(); 39 CodeRefElement.created() : super.created();
39 40
40 @override 41 @override
41 void attached() { 42 void attached() {
42 super.attached(); 43 super.attached();
43 _r.enable(); 44 _r.enable();
44 } 45 }
45 46
46 @override 47 @override
47 void detached() { 48 void detached() {
48 super.detached(); 49 super.detached();
49 children = []; 50 children = [];
50 _r.disable(notify: true); 51 _r.disable(notify: true);
51 } 52 }
52 53
53 void render() { 54 void render() {
54 final name = (_code.isOptimized ? '*' : '') + _code.name; 55 final name = (_code.isOptimized ? '*' : '') + _code.name;
55 children = [ 56 children = [
56 new AnchorElement( 57 new AnchorElement(
57 href: ((M.isSyntheticCode(_code.kind)) || (_isolate == null)) 58 href: M.isSyntheticCode(_code.kind)
58 ? null 59 ? null
59 : Uris.inspect(_isolate, object: _code))..text = name 60 : Uris.inspect(_isolate, object: _code))..text = name
60 ]; 61 ];
61 } 62 }
62 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698