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

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

Issue 1295693002: Add ObjectPool tag for external labels. Use LoadExternalLabel for native calls... (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/objectpool_view.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 objectpool_view; 5 library objectpool_view;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'observatory_element.dart'; 8 import 'observatory_element.dart';
9 import 'package:observatory/service.dart'; 9 import 'package:observatory/service.dart';
10 import 'package:polymer/polymer.dart'; 10 import 'package:polymer/polymer.dart';
11 11
12 @CustomTag('objectpool-view') 12 @CustomTag('objectpool-view')
13 class ObjectPoolViewElement extends ObservatoryElement { 13 class ObjectPoolViewElement extends ObservatoryElement {
14 @published ObjectPool pool; 14 @published ObjectPool pool;
15 @published List annotatedEntries; 15 @published List annotatedEntries;
16 16
17 ObjectPoolViewElement.created() : super.created(); 17 ObjectPoolViewElement.created() : super.created();
18 18
19 bool isServiceObject(o) => o is ServiceObject; 19 bool isServiceObject(o) => o is ServiceObject;
20 20
21 void poolChanged(oldValue) { 21 void poolChanged(oldValue) {
22 annotateRawEntries(); 22 annotateExternalLabels();
23 } 23 }
24 24
25 Future annotateRawEntries() { 25 Future annotateExternalLabels() {
26 var tasks = pool.entries.map((entry) { 26 var tasks = pool.entries.map((entry) {
27 if (entry is int) { 27 if (entry is String) {
28 var addr = entry.toRadixString(16); 28 var addr = entry.substring(2);
29 return pool.isolate.getObjectByAddress(addr).then((result) { 29 return pool.isolate.getObjectByAddress(addr).then((result) {
30 return result is ServiceObject ? result : null; 30 return result is ServiceObject ? result : null;
31 }); 31 });
32 } else { 32 } else {
33 return new Future.value(null); 33 return new Future.value(null);
34 } 34 }
35 }); 35 });
36 36
37 return Future.wait(tasks).then((results) => annotatedEntries = results); 37 return Future.wait(tasks).then((results) => annotatedEntries = results);
38 } 38 }
39 39
40 Future refresh() { 40 Future refresh() {
41 return pool.reload().then((_) => annotateRawEntries()); 41 return pool.reload().then((_) => annotateExternalLabels());
42 } 42 }
43 } 43 }
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/objectpool_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698