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

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

Issue 2304463002: Converted Observatory vm-view && isolate-view elements (Closed)
Patch Set: Fixed typo Created 4 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 // Some value smaller than the object ring, so requesting a large array 7 // Some value smaller than the object ring, so requesting a large array
8 // doesn't result in an expired ref because the elements lapped it in the 8 // doesn't result in an expired ref because the elements lapped it in the
9 // object ring. 9 // object ring.
10 const int kDefaultFieldLimit = 100; 10 const int kDefaultFieldLimit = 100;
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 @observable Duration get upTime { 1238 @observable Duration get upTime {
1239 if (startTime == null) { 1239 if (startTime == null) {
1240 return null; 1240 return null;
1241 } 1241 }
1242 return (new DateTime.now().difference(startTime)); 1242 return (new DateTime.now().difference(startTime));
1243 } 1243 }
1244 1244
1245 @observable Map counters = {}; 1245 @observable Map counters = {};
1246 1246
1247 void _updateRunState() { 1247 void _updateRunState() {
1248 topFrame = (pauseEvent != null ? pauseEvent.topFrame : null); 1248 topFrame = M.topFrame(pauseEvent);
1249 paused = (pauseEvent != null && 1249 paused = (pauseEvent != null &&
1250 pauseEvent.kind != ServiceEvent.kResume); 1250 !(pauseEvent is M.ResumeEvent));
1251 running = (!paused && topFrame != null); 1251 running = (!paused && topFrame != null);
1252 idle = (!paused && topFrame == null); 1252 idle = (!paused && topFrame == null);
1253 notifyPropertyChange(#topFrame, 0, 1); 1253 notifyPropertyChange(#topFrame, 0, 1);
1254 notifyPropertyChange(#paused, 0, 1); 1254 notifyPropertyChange(#paused, 0, 1);
1255 notifyPropertyChange(#running, 0, 1); 1255 notifyPropertyChange(#running, 0, 1);
1256 notifyPropertyChange(#idle, 0, 1); 1256 notifyPropertyChange(#idle, 0, 1);
1257 } 1257 }
1258 1258
1259 @observable ServiceEvent pauseEvent = null; 1259 @observable M.DebugEvent pauseEvent = null;
1260 @observable bool paused = false; 1260 @observable bool paused = false;
1261 @observable bool running = false; 1261 @observable bool running = false;
1262 @observable bool idle = false; 1262 @observable bool idle = false;
1263 @observable bool loading = true; 1263 @observable bool loading = true;
1264 @observable bool runnable = false; 1264 @observable bool runnable = false;
1265 @observable bool ioEnabled = false; 1265 @observable bool ioEnabled = false;
1266 @observable bool reloading = false; 1266 @observable bool reloading = false;
1267 M.IsolateStatus get status {
1268 if (paused) {
1269 return M.IsolateStatus.paused;
1270 }
1271 if (running) {
1272 return M.IsolateStatus.running;
1273 }
1274 if (idle) {
1275 return M.IsolateStatus.idle;
1276 }
1277 return M.IsolateStatus.loading;
1278 }
1267 1279
1268 final List<String> extensionRPCs = new List<String>(); 1280 final List<String> extensionRPCs = new List<String>();
1269 1281
1270 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>(); 1282 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>();
1271 final TagProfile tagProfile = new TagProfile(20); 1283 final TagProfile tagProfile = new TagProfile(20);
1272 1284
1273 Isolate._empty(ServiceObjectOwner owner) : super._empty(owner) { 1285 Isolate._empty(ServiceObjectOwner owner) : super._empty(owner) {
1274 assert(owner is VM); 1286 assert(owner is VM);
1275 } 1287 }
1276 1288
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 if (map['_debuggerSettings'] != null) { 1573 if (map['_debuggerSettings'] != null) {
1562 exceptionsPauseInfo = map['_debuggerSettings']['_exceptions']; 1574 exceptionsPauseInfo = map['_debuggerSettings']['_exceptions'];
1563 } else { 1575 } else {
1564 exceptionsPauseInfo = "none"; 1576 exceptionsPauseInfo = "none";
1565 } 1577 }
1566 1578
1567 var newPauseEvent = map['pauseEvent']; 1579 var newPauseEvent = map['pauseEvent'];
1568 assert((pauseEvent == null) || 1580 assert((pauseEvent == null) ||
1569 (newPauseEvent == null) || 1581 (newPauseEvent == null) ||
1570 !newPauseEvent.timestamp.isBefore(pauseEvent.timestamp)); 1582 !newPauseEvent.timestamp.isBefore(pauseEvent.timestamp));
1571 pauseEvent = newPauseEvent; 1583 pauseEvent = createEventFromServiceEvent(newPauseEvent);
1572 _updateRunState(); 1584 _updateRunState();
1573 error = map['error']; 1585 error = map['error'];
1574 1586
1575 libraries.clear(); 1587 libraries.clear();
1576 libraries.addAll(map['libraries']); 1588 libraries.addAll(map['libraries']);
1577 libraries.sort(ServiceObject.LexicalSortName); 1589 libraries.sort(ServiceObject.LexicalSortName);
1578 if (savedStartTime == null) { 1590 if (savedStartTime == null) {
1579 vm._buildIsolateList(); 1591 vm._buildIsolateList();
1580 } 1592 }
1581 1593
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 1663
1652 case ServiceEvent.kPauseStart: 1664 case ServiceEvent.kPauseStart:
1653 case ServiceEvent.kPauseExit: 1665 case ServiceEvent.kPauseExit:
1654 case ServiceEvent.kPauseBreakpoint: 1666 case ServiceEvent.kPauseBreakpoint:
1655 case ServiceEvent.kPauseInterrupted: 1667 case ServiceEvent.kPauseInterrupted:
1656 case ServiceEvent.kPauseException: 1668 case ServiceEvent.kPauseException:
1657 case ServiceEvent.kNone: 1669 case ServiceEvent.kNone:
1658 case ServiceEvent.kResume: 1670 case ServiceEvent.kResume:
1659 assert((pauseEvent == null) || 1671 assert((pauseEvent == null) ||
1660 !event.timestamp.isBefore(pauseEvent.timestamp)); 1672 !event.timestamp.isBefore(pauseEvent.timestamp));
1661 pauseEvent = event; 1673 pauseEvent = createEventFromServiceEvent(event);
1662 _updateRunState(); 1674 _updateRunState();
1663 break; 1675 break;
1664 1676
1665 case ServiceEvent.kGraph: 1677 case ServiceEvent.kGraph:
1666 _loadHeapSnapshot(event); 1678 _loadHeapSnapshot(event);
1667 break; 1679 break;
1668 1680
1669 case ServiceEvent.kGC: 1681 case ServiceEvent.kGC:
1670 // Ignore GC events for now. 1682 // Ignore GC events for now.
1671 break; 1683 break;
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 if (newScript != null && newScript.loaded) { 2223 if (newScript != null && newScript.loaded) {
2212 newScript._addBreakpoint(this); 2224 newScript._addBreakpoint(this);
2213 } 2225 }
2214 2226
2215 isSyntheticAsyncContinuation = map['isSyntheticAsyncContinuation'] != null; 2227 isSyntheticAsyncContinuation = map['isSyntheticAsyncContinuation'] != null;
2216 2228
2217 assert(resolved || location is UnresolvedSourceLocation); 2229 assert(resolved || location is UnresolvedSourceLocation);
2218 } 2230 }
2219 2231
2220 void remove() { 2232 void remove() {
2221 // Remove any references to this breakpoint. It has been removed.
2222 location.script._removeBreakpoint(this); 2233 location.script._removeBreakpoint(this);
2223 if ((isolate.pauseEvent != null) &&
2224 (isolate.pauseEvent.breakpoint != null) &&
2225 (isolate.pauseEvent.breakpoint.id == id)) {
2226 isolate.pauseEvent.breakpoint = null;
2227 }
2228 } 2234 }
2229 2235
2230 String toString() { 2236 String toString() {
2231 if (number != null) { 2237 if (number != null) {
2232 if (isSyntheticAsyncContinuation) { 2238 if (isSyntheticAsyncContinuation) {
2233 return 'Synthetic Async Continuation Breakpoint ${number}'; 2239 return 'Synthetic Async Continuation Breakpoint ${number}';
2234 } else { 2240 } else {
2235 return 'Breakpoint ${number} at ${location}'; 2241 return 'Breakpoint ${number} at ${location}';
2236 } 2242 }
2237 } else { 2243 } else {
(...skipping 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after
4451 var v = list[i]; 4457 var v = list[i];
4452 if ((v is ObservableMap) && _isServiceMap(v)) { 4458 if ((v is ObservableMap) && _isServiceMap(v)) {
4453 list[i] = owner.getFromMap(v); 4459 list[i] = owner.getFromMap(v);
4454 } else if (v is ObservableList) { 4460 } else if (v is ObservableList) {
4455 _upgradeObservableList(v, owner); 4461 _upgradeObservableList(v, owner);
4456 } else if (v is ObservableMap) { 4462 } else if (v is ObservableMap) {
4457 _upgradeObservableMap(v, owner); 4463 _upgradeObservableMap(v, owner);
4458 } 4464 }
4459 } 4465 }
4460 } 4466 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/repositories/isolate.dart ('k') | runtime/observatory/observatory_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698