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

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

Issue 2771293003: Resubmission of native memory allocation info surfacing in Observatory. Fixed crashing tests and st… (Closed)
Patch Set: Added page to Observatory to display native memory allocation information. 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 function_ref_element; 5 library function_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 10 show
(...skipping 18 matching lines...) Expand all
29 M.IsolateRef _isolate; 29 M.IsolateRef _isolate;
30 M.FunctionRef _function; 30 M.FunctionRef _function;
31 bool _qualified; 31 bool _qualified;
32 32
33 M.IsolateRef get isolate => _isolate; 33 M.IsolateRef get isolate => _isolate;
34 M.FunctionRef get function => _function; 34 M.FunctionRef get function => _function;
35 bool get qualified => _qualified; 35 bool get qualified => _qualified;
36 36
37 factory FunctionRefElement(M.IsolateRef isolate, M.FunctionRef function, 37 factory FunctionRefElement(M.IsolateRef isolate, M.FunctionRef function,
38 {bool qualified: true, RenderingQueue queue}) { 38 {bool qualified: true, RenderingQueue queue}) {
39 assert(isolate != null);
40 assert(function != null); 39 assert(function != null);
41 assert(qualified != null); 40 assert(qualified != null);
42 FunctionRefElement e = document.createElement(tag.name); 41 FunctionRefElement e = document.createElement(tag.name);
43 e._r = new RenderingScheduler(e, queue: queue); 42 e._r = new RenderingScheduler(e, queue: queue);
44 e._isolate = isolate; 43 e._isolate = isolate;
45 e._function = function; 44 e._function = function;
46 e._qualified = qualified; 45 e._qualified = qualified;
47 return e; 46 return e;
48 } 47 }
49 48
50 FunctionRefElement.created() : super.created(); 49 FunctionRefElement.created() : super.created();
51 50
52 @override 51 @override
53 void attached() { 52 void attached() {
54 super.attached(); 53 super.attached();
55 _r.enable(); 54 _r.enable();
56 } 55 }
57 56
58 @override 57 @override
59 void detached() { 58 void detached() {
60 super.detached(); 59 super.detached();
61 children = []; 60 children = [];
62 title = ''; 61 title = '';
63 _r.disable(notify: true); 62 _r.disable(notify: true);
64 } 63 }
65 64
66 void render() { 65 void render() {
67 var content = <Element>[ 66 var content = <Element>[
68 new AnchorElement( 67 new AnchorElement(
69 href: M.isSyntheticFunction(_function.kind) 68 href: (M.isSyntheticFunction(_function.kind) || (_isolate == null))
70 ? null 69 ? null
71 : Uris.inspect(_isolate, object: _function)) 70 : Uris.inspect(_isolate, object: _function))
72 ..text = _function.name 71 ..text = _function.name
73 ]; 72 ];
74 if (qualified) { 73 if (qualified) {
75 M.ObjectRef owner = _function.dartOwner; 74 M.ObjectRef owner = _function.dartOwner;
76 while (owner is M.FunctionRef) { 75 while (owner is M.FunctionRef) {
77 M.FunctionRef function = (owner as M.FunctionRef); 76 M.FunctionRef function = (owner as M.FunctionRef);
78 content.addAll([ 77 content.addAll([
79 new SpanElement()..text = '.', 78 new SpanElement()..text = '.',
80 new AnchorElement( 79 new AnchorElement(
81 href: M.isSyntheticFunction(function.kind) 80 href: (M.isSyntheticFunction(function.kind) || (_isolate == null))
82 ? null 81 ? null
83 : Uris.inspect(_isolate, object: function)) 82 : Uris.inspect(_isolate, object: function))
84 ..text = function.name 83 ..text = function.name
85 ]); 84 ]);
86 owner = function.dartOwner; 85 owner = function.dartOwner;
87 } 86 }
88 if (owner is M.ClassRef) { 87 if (owner is M.ClassRef) {
89 content.addAll([ 88 content.addAll([
90 new SpanElement()..text = '.', 89 new SpanElement()..text = '.',
91 new ClassRefElement(_isolate, owner, queue: _r.queue) 90 new ClassRefElement(_isolate, owner, queue: _r.queue)
92 ]); 91 ]);
93 } 92 }
94 } 93 }
95 children = content.reversed.toList(growable: false); 94 children = content.reversed.toList(growable: false);
96 title = M.getFunctionFullName(_function); 95 title = M.getFunctionFullName(_function);
97 } 96 }
98 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698