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

Side by Side Diff: runtime/observatory/lib/src/service/object.dart

Issue 1311503004: Remember when an isolate was paused and subtly display it in Obseravatory (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
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 /// Helper function for canceling a Future<StreamSubscription>. 7 /// Helper function for canceling a Future<StreamSubscription>.
8 Future cancelFutureSubscription( 8 Future cancelFutureSubscription(
9 Future<StreamSubscription> subscriptionFuture) async { 9 Future<StreamSubscription> subscriptionFuture) async {
10 if (subscriptionFuture != null) { 10 if (subscriptionFuture != null) {
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 return; 760 return;
761 } 761 }
762 // Note that upgrading the collection creates any isolates in the 762 // Note that upgrading the collection creates any isolates in the
763 // isolate list which are new. 763 // isolate list which are new.
764 _upgradeCollection(map, vm); 764 _upgradeCollection(map, vm);
765 765
766 _loaded = true; 766 _loaded = true;
767 version = map['version']; 767 version = map['version'];
768 targetCPU = map['targetCPU']; 768 targetCPU = map['targetCPU'];
769 architectureBits = map['architectureBits']; 769 architectureBits = map['architectureBits'];
770 var startTimeMillis = map['startTime']; 770 var startTimeMillis = map['startTime'].toInt();
771 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeMillis); 771 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeMillis);
772 refreshTime = new DateTime.now(); 772 refreshTime = new DateTime.now();
773 notifyPropertyChange(#upTime, 0, 1); 773 notifyPropertyChange(#upTime, 0, 1);
774 pid = map['pid']; 774 pid = map['pid'];
775 assertsEnabled = map['_assertsEnabled']; 775 assertsEnabled = map['_assertsEnabled'];
776 typeChecksEnabled = map['_typeChecksEnabled']; 776 typeChecksEnabled = map['_typeChecksEnabled'];
777 _removeDeadIsolates(map['isolates']); 777 _removeDeadIsolates(map['isolates']);
778 } 778 }
779 779
780 // Reload all isolates. 780 // Reload all isolates.
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 } 1231 }
1232 _loaded = true; 1232 _loaded = true;
1233 loading = false; 1233 loading = false;
1234 1234
1235 _upgradeCollection(map, isolate); 1235 _upgradeCollection(map, isolate);
1236 rootLibrary = map['rootLib']; 1236 rootLibrary = map['rootLib'];
1237 if (map['entry'] != null) { 1237 if (map['entry'] != null) {
1238 entry = map['entry']; 1238 entry = map['entry'];
1239 } 1239 }
1240 var savedStartTime = startTime; 1240 var savedStartTime = startTime;
1241 var startTimeInMillis = map['startTime']; 1241 var startTimeInMillis = map['startTime'].toInt();
1242 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis); 1242 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis);
1243 notifyPropertyChange(#upTime, 0, 1); 1243 notifyPropertyChange(#upTime, 0, 1);
1244 var countersMap = map['_tagCounters']; 1244 var countersMap = map['_tagCounters'];
1245 if (countersMap != null) { 1245 if (countersMap != null) {
1246 var names = countersMap['names']; 1246 var names = countersMap['names'];
1247 var counts = countersMap['counters']; 1247 var counts = countersMap['counters'];
1248 assert(names.length == counts.length); 1248 assert(names.length == counts.length);
1249 var sum = 0; 1249 var sum = 0;
1250 for (var i = 0; i < counts.length; i++) { 1250 for (var i = 0; i < counts.length; i++) {
1251 sum += counts[i]; 1251 sum += counts[i];
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 static const kConnectionClosed = 'ConnectionClosed'; 1726 static const kConnectionClosed = 'ConnectionClosed';
1727 static const kLogging = '_Logging'; 1727 static const kLogging = '_Logging';
1728 1728
1729 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner); 1729 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner);
1730 1730
1731 ServiceEvent.connectionClosed(this.reason) : super._empty(null) { 1731 ServiceEvent.connectionClosed(this.reason) : super._empty(null) {
1732 kind = kConnectionClosed; 1732 kind = kConnectionClosed;
1733 } 1733 }
1734 1734
1735 @observable String kind; 1735 @observable String kind;
1736 @observable DateTime timestamp;
1736 @observable Breakpoint breakpoint; 1737 @observable Breakpoint breakpoint;
1737 @observable Frame topFrame; 1738 @observable Frame topFrame;
1738 @observable Instance exception; 1739 @observable Instance exception;
1739 @observable Instance asyncContinuation; 1740 @observable Instance asyncContinuation;
1740 @observable bool atAsyncJump; 1741 @observable bool atAsyncJump;
1741 @observable ServiceObject inspectee; 1742 @observable ServiceObject inspectee;
1742 @observable ByteData data; 1743 @observable ByteData data;
1743 @observable int count; 1744 @observable int count;
1744 @observable String reason; 1745 @observable String reason;
1745 @observable String exceptions; 1746 @observable String exceptions;
1746 @observable String bytesAsString; 1747 @observable String bytesAsString;
1747 @observable Map logRecord; 1748 @observable Map logRecord;
1749
1748 int chunkIndex, chunkCount, nodeCount; 1750 int chunkIndex, chunkCount, nodeCount;
1749 1751
1750 @observable bool get isPauseEvent { 1752 @observable bool get isPauseEvent {
1751 return (kind == kPauseStart || 1753 return (kind == kPauseStart ||
1752 kind == kPauseExit || 1754 kind == kPauseExit ||
1753 kind == kPauseBreakpoint || 1755 kind == kPauseBreakpoint ||
1754 kind == kPauseInterrupted || 1756 kind == kPauseInterrupted ||
1755 kind == kPauseException); 1757 kind == kPauseException);
1756 } 1758 }
1757 1759
1758 void _update(ObservableMap map, bool mapIsRef) { 1760 void _update(ObservableMap map, bool mapIsRef) {
1759 _loaded = true; 1761 _loaded = true;
1760 _upgradeCollection(map, owner); 1762 _upgradeCollection(map, owner);
1761 assert(map['isolate'] == null || owner == map['isolate']); 1763 assert(map['isolate'] == null || owner == map['isolate']);
1764 timestamp =
1765 new DateTime.fromMillisecondsSinceEpoch(map['timestamp'].toInt());
1762 kind = map['kind']; 1766 kind = map['kind'];
1763 notifyPropertyChange(#isPauseEvent, 0, 1); 1767 notifyPropertyChange(#isPauseEvent, 0, 1);
1764 name = 'ServiceEvent $kind'; 1768 name = 'ServiceEvent $kind';
1765 vmName = name; 1769 vmName = name;
1766 if (map['breakpoint'] != null) { 1770 if (map['breakpoint'] != null) {
1767 breakpoint = map['breakpoint']; 1771 breakpoint = map['breakpoint'];
1768 } 1772 }
1769 // TODO(turnidge): Expose the full list of breakpoints. For now 1773 // TODO(turnidge): Expose the full list of breakpoints. For now
1770 // we just pretend like there is only one active breakpoint. 1774 // we just pretend like there is only one active breakpoint.
1771 if (map['pauseBreakpoints'] != null) { 1775 if (map['pauseBreakpoints'] != null) {
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after
3796 var v = list[i]; 3800 var v = list[i];
3797 if ((v is ObservableMap) && _isServiceMap(v)) { 3801 if ((v is ObservableMap) && _isServiceMap(v)) {
3798 list[i] = owner.getFromMap(v); 3802 list[i] = owner.getFromMap(v);
3799 } else if (v is ObservableList) { 3803 } else if (v is ObservableList) {
3800 _upgradeObservableList(v, owner); 3804 _upgradeObservableList(v, owner);
3801 } else if (v is ObservableMap) { 3805 } else if (v is ObservableMap) {
3802 _upgradeObservableMap(v, owner); 3806 _upgradeObservableMap(v, owner);
3803 } 3807 }
3804 } 3808 }
3805 } 3809 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698