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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.dart

Issue 184233007: Refactor Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library instance_ref_element;
6
7 import 'package:logging/logging.dart';
8 import 'package:polymer/polymer.dart';
9 import 'service_ref.dart';
10
11 @CustomTag('instance-ref')
12 class InstanceRefElement extends ServiceRefElement {
13 InstanceRefElement.created() : super.created();
14
15 String get name {
16 if (ref == null) {
17 return super.name;
18 }
19 return ref['preview'];
20 }
21
22 // TODO(turnidge): This is here to workaround vm/dart2js differences.
23 dynamic expander() {
24 return expandEvent;
25 }
26
27 void expandEvent(bool expand, var done) {
28 print("Calling expandEvent");
29 if (expand) {
30 app.requestManager.requestMap(url).then((map) {
31 print("Result is : $map");
32 ref['fields'] = map['fields'];
33 ref['elements'] = map['elements'];
34 ref['length'] = map['length'];
35 print("ref is $ref");
36 }).catchError((e, trace) {
37 Logger.root.severe('Error while expanding instance-ref: $e\n$trace');
38 }).whenComplete(done);
39 } else {
40 ref['fields'] = null;
41 ref['elements'] = null;
42 done();
43 }
44 }
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698