Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 8 |
| 9 import 'package:logging/logging.dart'; | 9 import 'package:logging/logging.dart'; |
| 10 import 'package:observatory/models.dart' as M; | |
| 10 import 'package:observatory/service.dart'; | 11 import 'package:observatory/service.dart'; |
| 11 import 'package:polymer/polymer.dart'; | 12 import 'package:polymer/polymer.dart'; |
| 12 | 13 |
| 13 import 'class_ref.dart'; | 14 import 'class_ref.dart'; |
| 15 import 'class_ref_as_value.dart'; | |
| 16 import 'code_ref.dart'; | |
| 17 import 'error_ref.dart'; | |
| 18 import 'function_ref.dart'; | |
| 14 import 'library_ref.dart'; | 19 import 'library_ref.dart'; |
| 20 import 'library_ref_as_value.dart'; | |
| 21 import 'script_ref.dart'; | |
| 15 import 'observatory_element.dart'; | 22 import 'observatory_element.dart'; |
| 16 | 23 |
| 17 class ServiceRefElement extends ObservatoryElement { | 24 class ServiceRefElement extends ObservatoryElement { |
| 18 @published ServiceObject ref; | 25 @published ServiceObject ref; |
| 19 @published bool internal = false; | 26 @published bool internal = false; |
| 20 @published String expandKey; | 27 @published String expandKey; |
| 21 ServiceRefElement.created() : super.created(); | 28 ServiceRefElement.created() : super.created(); |
| 22 | 29 |
| 23 void refChanged(oldValue) { | 30 void refChanged(oldValue) { |
| 24 notifyPropertyChange(#url, "", url); | 31 notifyPropertyChange(#url, "", url); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 class AnyServiceRefElement extends ObservatoryElement { | 91 class AnyServiceRefElement extends ObservatoryElement { |
| 85 @published ServiceObject ref; | 92 @published ServiceObject ref; |
| 86 @published String expandKey; | 93 @published String expandKey; |
| 87 @published bool asValue = false; | 94 @published bool asValue = false; |
| 88 AnyServiceRefElement.created() : super.created(); | 95 AnyServiceRefElement.created() : super.created(); |
| 89 | 96 |
| 90 Element _constructElementForRef() { | 97 Element _constructElementForRef() { |
| 91 var type = ref.type; | 98 var type = ref.type; |
| 92 switch (type) { | 99 switch (type) { |
| 93 case 'Class': | 100 case 'Class': |
| 94 ClassRefElement element = new Element.tag('class-ref'); | 101 if (asValue) { |
| 95 element.ref = ref; | 102 ClassRefAsValueElement element = |
| 96 element.asValue = asValue; | 103 new Element.tag('class-ref-as-element'); |
| 97 return element; | 104 element.ref = ref; |
| 105 return element; | |
| 106 } | |
| 107 return new ClassRefElement(ref.isolate, ref as M.ClassRef, | |
| 108 queue: app.queue); | |
|
Cutch
2016/08/03 00:32:03
weird indentation here
cbernaschina
2016/08/03 22:12:12
Done.
| |
| 98 case 'Code': | 109 case 'Code': |
| 99 ServiceRefElement element = new Element.tag('code-ref'); | 110 return new CodeRefElement(ref.isolate, ref as M.Code, queue: app.queue); |
| 100 element.ref = ref; | |
| 101 return element; | |
| 102 case 'Context': | 111 case 'Context': |
| 103 ServiceRefElement element = new Element.tag('context-ref'); | 112 ServiceRefElement element = new Element.tag('context-ref'); |
| 104 element.ref = ref; | 113 element.ref = ref; |
| 105 return element; | 114 return element; |
| 106 case 'Error': | 115 case 'Error': |
| 107 ServiceRefElement element = new Element.tag('error-ref'); | 116 return new ErrorRefElement(ref as M.ErrorRef, queue: app.queue); |
| 108 element.ref = ref; | |
| 109 return element; | |
| 110 case 'Field': | 117 case 'Field': |
| 111 ServiceRefElement element = new Element.tag('field-ref'); | 118 ServiceRefElement element = new Element.tag('field-ref'); |
| 112 element.ref = ref; | 119 element.ref = ref; |
| 113 return element; | 120 return element; |
| 114 case 'Function': | 121 case 'Function': |
| 115 ServiceRefElement element = new Element.tag('function-ref'); | 122 return new FunctionRefElement(ref.isolate, ref as M.FunctionRef, |
| 116 element.ref = ref; | 123 queue: app.queue); |
| 117 return element; | |
| 118 case 'Library': | 124 case 'Library': |
| 119 LibraryRefElement element = new Element.tag('library-ref'); | 125 if (asValue) { |
| 120 element.ref = ref; | 126 LibraryRefAsValueElement element = |
| 121 element.asValue = asValue; | 127 new Element.tag('library-ref-as-value'); |
| 122 return element; | 128 element.ref = ref; |
| 129 return element; | |
| 130 } | |
| 131 return new LibraryRefElement(ref.isolate, ref as M.LibraryRef, | |
| 132 queue: app.queue); | |
|
Cutch
2016/08/03 00:32:03
ditto
cbernaschina
2016/08/03 22:12:12
Done.
| |
| 123 case 'Object': | 133 case 'Object': |
| 124 ServiceRefElement element = new Element.tag('object-ref'); | 134 ServiceRefElement element = new Element.tag('object-ref'); |
| 125 element.ref = ref; | 135 element.ref = ref; |
| 126 return element; | 136 return element; |
| 127 case 'Script': | 137 case 'Script': |
| 128 ServiceRefElement element = new Element.tag('script-ref'); | 138 return new ScriptRefElement(ref.isolate, ref as M.ScriptRef, |
| 129 element.ref = ref; | 139 queue: app.queue); |
| 130 return element; | |
| 131 case 'Instance': | 140 case 'Instance': |
| 132 case 'Sentinel': | 141 case 'Sentinel': |
| 133 ServiceRefElement element = new Element.tag('instance-ref'); | 142 ServiceRefElement element = new Element.tag('instance-ref'); |
| 134 element.ref = ref; | 143 element.ref = ref; |
| 135 if (expandKey != null) { | 144 if (expandKey != null) { |
| 136 element.expandKey = expandKey; | 145 element.expandKey = expandKey; |
| 137 } | 146 } |
| 138 return element; | 147 return element; |
| 139 default: | 148 default: |
| 140 SpanElement element = new Element.tag('span'); | 149 SpanElement element = new Element.tag('span'); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 157 return; | 166 return; |
| 158 } | 167 } |
| 159 children.add(element); | 168 children.add(element); |
| 160 } | 169 } |
| 161 } | 170 } |
| 162 | 171 |
| 163 @CustomTag('object-ref') | 172 @CustomTag('object-ref') |
| 164 class ObjectRefElement extends ServiceRefElement { | 173 class ObjectRefElement extends ServiceRefElement { |
| 165 ObjectRefElement.created() : super.created(); | 174 ObjectRefElement.created() : super.created(); |
| 166 } | 175 } |
| OLD | NEW |