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

Side by Side Diff: runtime/observatory/lib/src/elements/inbound_reference.dart

Issue 2265513003: Converted Observatory object-common element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixed typos Created 4 years, 4 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
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 inbound_reference_element;
6
7 import 'dart:async';
8 import 'package:polymer/polymer.dart';
9 import 'package:observatory/service.dart';
10 import 'observatory_element.dart';
11
12 @CustomTag('inbound-reference')
13 class InboundReferenceElement extends ObservatoryElement {
14 @published ObservableMap ref;
15 InboundReferenceElement.created() : super.created();
16
17 // I.e., inbound references to 'source' for recursive pointer chasing.
18 @observable ObservableList inboundReferences;
19 Future<ServiceObject> fetchInboundReferences(arg) {
20 var source = ref['source'];
21 return source.isolate.getInboundReferences(source, arg)
22 .then((ServiceMap response) {
23 inboundReferences = new ObservableList.from(response['references']);
24 });
25 }
26
27 // TODO(turnidge): This is here to workaround vm/dart2js differences.
28 dynamic expander() {
29 return expandEvent;
30 }
31
32 void expandEvent(bool expand, Function onDone) {
33 if (expand) {
34 fetchInboundReferences(100).then((result) {
35 notifyPropertyChange(#ref, 0, 1);
36 }).whenComplete(onDone);
37 } else {
38 inboundReferences = null;
39 onDone();
40 }
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698