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

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

Issue 509563004: Give instances their own model class; move DartErrors out of instance-ref into their own error-ref. (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 instance_ref_element; 5 library instance_ref_element;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
8 import 'package:observatory/service.dart'; 8 import 'package:observatory/service.dart';
9 import 'service_ref.dart'; 9 import 'service_ref.dart';
10 10
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 return super.hoverText; 31 return super.hoverText;
32 } 32 }
33 33
34 // TODO(turnidge): This is here to workaround vm/dart2js differences. 34 // TODO(turnidge): This is here to workaround vm/dart2js differences.
35 dynamic expander() { 35 dynamic expander() {
36 return expandEvent; 36 return expandEvent;
37 } 37 }
38 38
39 void expandEvent(bool expand, var done) { 39 void expandEvent(bool expand, var done) {
40 assert(ref is ServiceMap); 40 assert(ref is Instance);
41 if (expand) { 41 if (expand) {
42 ref.reload().then((result) { 42 ref.reload().then((result) {
43 if (result['valueAsString'] != null) { 43 if (result.valueAsString != null) {
44 result.name = result['valueAsString']; 44 result.name = result.valueAsString;
45 result.vmName = result['valueAsString']; 45 result.vmName = result.valueAsString;
46 } 46 }
47 ref = result; 47 ref = result;
48 notifyPropertyChange(#ref, 0, 1); 48 notifyPropertyChange(#ref, 0, 1);
49 }).whenComplete(done); 49 }).whenComplete(done);
50 } else { 50 } else {
51 ServiceMap refMap = ref; 51 Instance refMap = ref;
52 refMap['fields'] = null; 52 refMap.fields = null;
53 refMap['elements'] = null; 53 refMap.elements = null;
54 done(); 54 done();
55 } 55 }
56 } 56 }
57 } 57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698