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

Side by Side Diff: runtime/bin/vmservice/observatory/lib/src/elements/service_ref.dart

Issue 536273002: Teach the Observatory about WeakProperties (ephemerons). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: build Created 6 years, 3 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 | Annotate | Revision Log
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 service_ref_element; 5 library service_ref_element;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'package:logging/logging.dart'; 8 import 'package:logging/logging.dart';
9 import 'package:polymer/polymer.dart'; 9 import 'package:polymer/polymer.dart';
10 import 'observatory_element.dart'; 10 import 'observatory_element.dart';
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 case 'Double': 101 case 'Double':
102 case 'GrowableObjectArray': 102 case 'GrowableObjectArray':
103 case 'Instance': 103 case 'Instance':
104 case 'Mint': 104 case 'Mint':
105 case 'MirrorReference': 105 case 'MirrorReference':
106 case 'Null': 106 case 'Null':
107 case 'Sentinel': // TODO(rmacnak): Separate this out. 107 case 'Sentinel': // TODO(rmacnak): Separate this out.
108 case 'Smi': 108 case 'Smi':
109 case 'String': 109 case 'String':
110 case 'Type': 110 case 'Type':
111 case 'WeakProperty':
111 ServiceRefElement element = new Element.tag('instance-ref'); 112 ServiceRefElement element = new Element.tag('instance-ref');
112 element.ref = ref; 113 element.ref = ref;
113 return element; 114 return element;
114 default: 115 default:
115 SpanElement element = new Element.tag('span'); 116 SpanElement element = new Element.tag('span');
116 element.text = "<<Unknown service ref: $ref>>"; 117 element.text = "<<Unknown service ref: $ref>>";
117 return element; 118 return element;
118 } 119 }
119 } 120 }
120 121
121 refChanged(oldValue) { 122 refChanged(oldValue) {
122 // Remove the current view. 123 // Remove the current view.
123 children.clear(); 124 children.clear();
124 if (ref == null) { 125 if (ref == null) {
125 Logger.root.info('Viewing null object.'); 126 Logger.root.info('Viewing null object.');
126 return; 127 return;
127 } 128 }
128 var type = ref.vmType; 129 var type = ref.vmType;
129 var element = _constructElementForRef(); 130 var element = _constructElementForRef();
130 if (element == null) { 131 if (element == null) {
131 Logger.root.info('Unable to find a ref element for \'${type}\''); 132 Logger.root.info('Unable to find a ref element for \'${type}\'');
132 return; 133 return;
133 } 134 }
134 children.add(element); 135 children.add(element);
135 Logger.root.info('Viewing object of \'${type}\''); 136 Logger.root.info('Viewing object of \'${type}\'');
136 } 137 }
137 } 138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698