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

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: 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 case 'Closure': 100 case 'Closure':
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 'Null': 105 case 'Null':
106 case 'Sentinel': // TODO(rmacnak): Separate this out. 106 case 'Sentinel': // TODO(rmacnak): Separate this out.
107 case 'Smi': 107 case 'Smi':
108 case 'String': 108 case 'String':
109 case 'Type': 109 case 'Type':
110 case 'WeakProperty':
110 ServiceRefElement element = new Element.tag('instance-ref'); 111 ServiceRefElement element = new Element.tag('instance-ref');
111 element.ref = ref; 112 element.ref = ref;
112 return element; 113 return element;
113 default: 114 default:
114 SpanElement element = new Element.tag('span'); 115 SpanElement element = new Element.tag('span');
115 element.text = "<<Unknown service ref: $ref>>"; 116 element.text = "<<Unknown service ref: $ref>>";
116 return element; 117 return element;
117 } 118 }
118 } 119 }
119 120
120 refChanged(oldValue) { 121 refChanged(oldValue) {
121 // Remove the current view. 122 // Remove the current view.
122 children.clear(); 123 children.clear();
123 if (ref == null) { 124 if (ref == null) {
124 Logger.root.info('Viewing null object.'); 125 Logger.root.info('Viewing null object.');
125 return; 126 return;
126 } 127 }
127 var type = ref.vmType; 128 var type = ref.vmType;
128 var element = _constructElementForRef(); 129 var element = _constructElementForRef();
129 if (element == null) { 130 if (element == null) {
130 Logger.root.info('Unable to find a ref element for \'${type}\''); 131 Logger.root.info('Unable to find a ref element for \'${type}\'');
131 return; 132 return;
132 } 133 }
133 children.add(element); 134 children.add(element);
134 Logger.root.info('Viewing object of \'${type}\''); 135 Logger.root.info('Viewing object of \'${type}\'');
135 } 136 }
136 } 137 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698