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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/service/object.dart

Issue 262823012: Various vmservice/observatory fixes: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 7 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
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/elements/service_ref.dart ('k') | runtime/vm/isolate.cc » ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of service; 5 part of service;
6 6
7 /// A [ServiceObject] is an object known to the VM service and is tied 7 /// A [ServiceObject] is an object known to the VM service and is tied
8 /// to an owning [Isolate]. 8 /// to an owning [Isolate].
9 abstract class ServiceObject extends Observable { 9 abstract class ServiceObject extends Observable {
10 /// The owner of this [ServiceObject]. This can be an [Isolate], a 10 /// The owner of this [ServiceObject]. This can be an [Isolate], a
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 return vm.getAsMap(relativeLink(id)).then((ObservableMap map) { 570 return vm.getAsMap(relativeLink(id)).then((ObservableMap map) {
571 var obj = new ServiceObject._fromMap(this, map); 571 var obj = new ServiceObject._fromMap(this, map);
572 if (obj.canCache) { 572 if (obj.canCache) {
573 _cache.putIfAbsent(id, () => obj); 573 _cache.putIfAbsent(id, () => obj);
574 } 574 }
575 return obj; 575 return obj;
576 }); 576 });
577 } 577 }
578 578
579 @observable ServiceMap rootLib; 579 @observable ServiceMap rootLib;
580 @observable ObservableList<ServiceMap> libraries =
581 new ObservableList<ServiceMap>();
580 @observable ObservableMap topFrame; 582 @observable ObservableMap topFrame;
581 583
582 @observable String name; 584 @observable String name;
583 @observable String vmName; 585 @observable String vmName;
584 @observable String mainPort; 586 @observable String mainPort;
585 @observable Map entry; 587 @observable Map entry;
586 588
587 @observable final Map<String, double> timers = 589 @observable final Map<String, double> timers =
588 toObservable(new Map<String, double>()); 590 toObservable(new Map<String, double>());
589 591
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 oldHeapUsed = map['heap']['usedOld']; 662 oldHeapUsed = map['heap']['usedOld'];
661 newHeapCapacity = map['heap']['capacityNew']; 663 newHeapCapacity = map['heap']['capacityNew'];
662 oldHeapCapacity = map['heap']['capacityOld']; 664 oldHeapCapacity = map['heap']['capacityOld'];
663 665
664 // Isolate status 666 // Isolate status
665 pausedOnStart = map['pausedOnStart']; 667 pausedOnStart = map['pausedOnStart'];
666 pausedOnExit = map['pausedOnExit']; 668 pausedOnExit = map['pausedOnExit'];
667 running = map['topFrame'] != null; 669 running = map['topFrame'] != null;
668 idle = !pausedOnStart && !pausedOnExit && !running; 670 idle = !pausedOnStart && !pausedOnExit && !running;
669 error = map['error']; 671 error = map['error'];
672
673 libraries.clear();
674 for (var lib in map['libraries']) {
675 libraries.add(lib);
676 }
677 libraries.sort((a,b) => a.name.compareTo(b.name));
670 } 678 }
671 679
672 Future<TagProfile> updateTagProfile() { 680 Future<TagProfile> updateTagProfile() {
673 return vm.getAsMap(relativeLink('profile/tag')).then((ObservableMap m) { 681 return vm.getAsMap(relativeLink('profile/tag')).then((ObservableMap m) {
674 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0; 682 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0;
675 tagProfile._processTagProfile(seconds, m); 683 tagProfile._processTagProfile(seconds, m);
676 return tagProfile; 684 return tagProfile;
677 }); 685 });
678 } 686 }
679 687
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 853
846 class ScriptLine { 854 class ScriptLine {
847 @reflectable final int line; 855 @reflectable final int line;
848 @reflectable final String text; 856 @reflectable final String text;
849 ScriptLine(this.line, this.text); 857 ScriptLine(this.line, this.text);
850 } 858 }
851 859
852 class Script extends ServiceObject { 860 class Script extends ServiceObject {
853 @reflectable final lines = new ObservableList<ScriptLine>(); 861 @reflectable final lines = new ObservableList<ScriptLine>();
854 @reflectable final hits = new ObservableMap<int, int>(); 862 @reflectable final hits = new ObservableMap<int, int>();
855 @observable ServiceObject library;
856 @observable String kind; 863 @observable String kind;
857 @observable int firstTokenPos; 864 @observable int firstTokenPos;
858 @observable int lastTokenPos; 865 @observable int lastTokenPos;
859 bool get canCache => true; 866 bool get canCache => true;
860 bool get immutable => true; 867 bool get immutable => true;
861 868
862 String _shortUrl; 869 String _shortUrl;
863 String _url; 870 String _url;
864 871
865 Script._empty(ServiceObjectOwner owner) : super._empty(owner); 872 Script._empty(ServiceObjectOwner owner) : super._empty(owner);
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 var v = list[i]; 1427 var v = list[i];
1421 if ((v is ObservableMap) && _isServiceMap(v)) { 1428 if ((v is ObservableMap) && _isServiceMap(v)) {
1422 list[i] = owner.getFromMap(v); 1429 list[i] = owner.getFromMap(v);
1423 } else if (v is ObservableList) { 1430 } else if (v is ObservableList) {
1424 _upgradeObservableList(v, owner); 1431 _upgradeObservableList(v, owner);
1425 } else if (v is ObservableMap) { 1432 } else if (v is ObservableMap) {
1426 _upgradeObservableMap(v, owner); 1433 _upgradeObservableMap(v, owner);
1427 } 1434 }
1428 } 1435 }
1429 } 1436 }
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/elements/service_ref.dart ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698