OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 persitent_handles_page; | 5 library persitent_handles_page; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/src/elements/containers/virtual_collection.dart'; | 10 import 'package:observatory/src/elements/containers/virtual_collection.dart'; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 ..text = '0B', | 179 ..text = '0B', |
180 new SpanElement() | 180 new SpanElement() |
181 ..classes = ['peer'] | 181 ..classes = ['peer'] |
182 ..text = '0x00000', | 182 ..text = '0x00000', |
183 new SpanElement()..classes = ['object'], | 183 new SpanElement()..classes = ['object'], |
184 new SpanElement() | 184 new SpanElement() |
185 ..classes = ['finalizer'] | 185 ..classes = ['finalizer'] |
186 ..text = 'dart::Class::Method()' | 186 ..text = 'dart::Class::Method()' |
187 ]; | 187 ]; |
188 | 188 |
189 Element _createWeakHeader() => new DivElement() | 189 List<HtmlElement> _createWeakHeader() => [ |
190 ..classes = ['weak-item'] | 190 new DivElement() |
191 ..children = [ | 191 ..classes = ['weak-item'] |
192 _createHeaderButton(const ['external-size'], 'External Size', | 192 ..children = [ |
193 _SortingField.externalSize, _SortingDirection.descending), | 193 _createHeaderButton(const ['external-size'], 'External Size', |
194 _createHeaderButton(const ['peer'], 'Peer', _SortingField.peer, | 194 _SortingField.externalSize, _SortingDirection.descending), |
195 _SortingDirection.descending), | 195 _createHeaderButton(const ['peer'], 'Peer', _SortingField.peer, |
196 new SpanElement() | 196 _SortingDirection.descending), |
197 ..classes = ['object'] | 197 new SpanElement() |
198 ..text = 'Object', | 198 ..classes = ['object'] |
199 _createHeaderButton(const ['finalizer'], 'Finalizer Callback', | 199 ..text = 'Object', |
200 _SortingField.finalizerCallback, _SortingDirection.ascending) | 200 _createHeaderButton(const ['finalizer'], 'Finalizer Callback', |
201 ]; | 201 _SortingField.finalizerCallback, _SortingDirection.ascending) |
| 202 ] |
| 203 ]; |
202 | 204 |
203 ButtonElement _createHeaderButton(List<String> classes, String text, | 205 ButtonElement _createHeaderButton(List<String> classes, String text, |
204 _SortingField field, _SortingDirection direction) => | 206 _SortingField field, _SortingDirection direction) => |
205 new ButtonElement() | 207 new ButtonElement() |
206 ..classes = classes | 208 ..classes = classes |
207 ..text = _sortingField != field | 209 ..text = _sortingField != field |
208 ? text | 210 ? text |
209 : _sortingDirection == _SortingDirection.ascending | 211 : _sortingDirection == _SortingDirection.ascending |
210 ? '$text▼' | 212 ? '$text▼' |
211 : '$text▲' | 213 : '$text▲' |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 _r.dirty(); | 252 _r.dirty(); |
251 _handles = await _repository.get(_isolate); | 253 _handles = await _repository.get(_isolate); |
252 _r.dirty(); | 254 _r.dirty(); |
253 } | 255 } |
254 | 256 |
255 static int _getExternalSize(M.WeakPersistentHandle h) => h.externalSize; | 257 static int _getExternalSize(M.WeakPersistentHandle h) => h.externalSize; |
256 static String _getPeer(M.WeakPersistentHandle h) => h.peer; | 258 static String _getPeer(M.WeakPersistentHandle h) => h.peer; |
257 static String _getFinalizerCallback(M.WeakPersistentHandle h) => | 259 static String _getFinalizerCallback(M.WeakPersistentHandle h) => |
258 '${h.callbackSymbolName} (${h.callbackAddress})'; | 260 '${h.callbackSymbolName} (${h.callbackAddress})'; |
259 } | 261 } |
OLD | NEW |