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

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

Issue 515303005: Allow observatory to distinguish between user-level and vm-level types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js, fix test 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_object_view_element; 5 library service_object_view_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:observatory/service.dart'; 9 import 'package:observatory/service.dart';
10 import 'package:observatory/tracer.dart'; 10 import 'package:observatory/tracer.dart';
11 import 'package:observatory/elements.dart'; 11 import 'package:observatory/elements.dart';
12 import 'package:polymer/polymer.dart'; 12 import 'package:polymer/polymer.dart';
13 import 'observatory_element.dart'; 13 import 'observatory_element.dart';
14 14
15 @CustomTag('service-view') 15 @CustomTag('service-view')
16 class ServiceObjectViewElement extends ObservatoryElement { 16 class ServiceObjectViewElement extends ObservatoryElement {
17 @published ServiceObject object; 17 @published ServiceObject object;
18 @published ObservableMap args; 18 @published ObservableMap args;
19 19
20 ServiceObjectViewElement.created() : super.created(); 20 ServiceObjectViewElement.created() : super.created();
21 21
22 ObservatoryElement _constructElementForObject() { 22 ObservatoryElement _constructElementForObject() {
23 var type = object.serviceType; 23 var type = object.vmType;
24 switch (type) { 24 switch (type) {
25 case 'AllocationProfile': 25 case 'AllocationProfile':
26 HeapProfileElement element = new Element.tag('heap-profile'); 26 HeapProfileElement element = new Element.tag('heap-profile');
27 element.profile = object; 27 element.profile = object;
28 return element; 28 return element;
29 case 'BreakpointList': 29 case 'BreakpointList':
30 BreakpointListElement element = new Element.tag('breakpoint-list'); 30 BreakpointListElement element = new Element.tag('breakpoint-list');
31 element.msg = object; 31 element.msg = object;
32 return element; 32 return element;
33 case 'Class': 33 case 'Class':
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 } 192 }
193 193
194 objectChanged(oldValue) { 194 objectChanged(oldValue) {
195 // Remove the current view. 195 // Remove the current view.
196 children.clear(); 196 children.clear();
197 if (object == null) { 197 if (object == null) {
198 Logger.root.info('Viewing null object.'); 198 Logger.root.info('Viewing null object.');
199 return; 199 return;
200 } 200 }
201 var type = object.serviceType; 201 var type = object.vmType;
202 var element = _constructElementForObject(); 202 var element = _constructElementForObject();
203 if (element == null) { 203 if (element == null) {
204 Logger.root.info('Unable to find a view element for \'${type}\''); 204 Logger.root.info('Unable to find a view element for \'${type}\'');
205 return; 205 return;
206 } 206 }
207 children.add(element); 207 children.add(element);
208 Logger.root.info('Viewing object of \'${type}\''); 208 Logger.root.info('Viewing object of \'${type}\'');
209 } 209 }
210 } 210 }
211 211
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 dynamic expander() { 256 dynamic expander() {
257 return expandEvent; 257 return expandEvent;
258 } 258 }
259 259
260 void expandEvent(bool exp, var done) { 260 void expandEvent(bool exp, var done) {
261 expand = exp; 261 expand = exp;
262 done(); 262 done();
263 } 263 }
264 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698