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

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

Issue 511413002: Revert "Give instances their own model class; move DartErrors out of instance-ref into their own er… (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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 60
61 @CustomTag('any-service-ref') 61 @CustomTag('any-service-ref')
62 class AnyServiceRefElement extends ObservatoryElement { 62 class AnyServiceRefElement extends ObservatoryElement {
63 @published ServiceObject ref; 63 @published ServiceObject ref;
64 AnyServiceRefElement.created() : super.created(); 64 AnyServiceRefElement.created() : super.created();
65 65
66 Element _constructElementForRef() { 66 Element _constructElementForRef() {
67 var type = ref.serviceType; 67 var type = ref.serviceType;
68 switch (type) { 68 switch (type) {
69 case 'Class': 69 case 'Class':
70 ServiceRefElement element = new Element.tag('class-ref'); 70 ServiceRefElement element = new Element.tag('class-ref');
71 element.ref = ref; 71 element.ref = ref;
72 return element; 72 return element;
73 case 'Code': 73 case 'Code':
74 ServiceRefElement element = new Element.tag('code-ref'); 74 ServiceRefElement element = new Element.tag('code-ref');
75 element.ref = ref; 75 element.ref = ref;
76 return element; 76 return element;
77 case 'Error':
78 ServiceRefElement element = new Element.tag('error-ref');
79 element.ref = ref;
80 return element;
81 case 'Field': 77 case 'Field':
82 ServiceRefElement element = new Element.tag('field-ref'); 78 ServiceRefElement element = new Element.tag('field-ref');
83 element.ref = ref; 79 element.ref = ref;
84 return element; 80 return element;
85 case 'Function': 81 case 'Function':
86 ServiceRefElement element = new Element.tag('function-ref'); 82 ServiceRefElement element = new Element.tag('function-ref');
87 element.ref = ref; 83 element.ref = ref;
88 return element; 84 return element;
89 case 'Library': 85 case 'Library':
90 ServiceRefElement element = new Element.tag('library-ref'); 86 ServiceRefElement element = new Element.tag('library-ref');
91 element.ref = ref; 87 element.ref = ref;
92 return element; 88 return element;
93 case 'Array': 89 case 'Array':
94 case 'Bigint': 90 case 'Bigint':
95 case 'Bool': 91 case 'Bool':
96 case 'Closure': 92 case 'Closure':
97 case 'Double': 93 case 'Double':
98 case 'GrowableObjectArray': 94 case 'GrowableObjectArray':
99 case 'Instance': 95 case 'Instance':
100 case 'Mint': 96 case 'Mint':
101 case 'Null': 97 case 'Null':
102 case 'Sentinel': // TODO(rmacnak): Separate this out.
103 case 'Smi': 98 case 'Smi':
104 case 'String': 99 case 'String':
105 case 'Type': 100 case 'Type':
106 ServiceRefElement element = new Element.tag('instance-ref'); 101 ServiceRefElement element = new Element.tag('instance-ref');
107 element.ref = ref; 102 element.ref = ref;
108 return element; 103 return element;
109 default: 104 default:
110 SpanElement element = new Element.tag('span'); 105 SpanElement element = new Element.tag('span');
111 element.text = "<<Unknown service ref: $ref>>"; 106 element.text = "<<Unknown service ref: $ref>>";
112 return element; 107 return element;
(...skipping 10 matching lines...) Expand all
123 var type = ref.serviceType; 118 var type = ref.serviceType;
124 var element = _constructElementForRef(); 119 var element = _constructElementForRef();
125 if (element == null) { 120 if (element == null) {
126 Logger.root.info('Unable to find a ref element for \'${type}\''); 121 Logger.root.info('Unable to find a ref element for \'${type}\'');
127 return; 122 return;
128 } 123 }
129 children.add(element); 124 children.add(element);
130 Logger.root.info('Viewing object of \'${type}\''); 125 Logger.root.info('Viewing object of \'${type}\'');
131 } 126 }
132 } 127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698