Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 /// An RpcException represents an exceptional event that happened | 7 /// An RpcException represents an exceptional event that happened |
| 8 /// while invoking an rpc. | 8 /// while invoking an rpc. |
| 9 abstract class RpcException implements Exception { | 9 abstract class RpcException implements Exception { |
| 10 RpcException(this.message); | 10 RpcException(this.message); |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1163 case ServiceEvent.kInspect: | 1163 case ServiceEvent.kInspect: |
| 1164 // Handled elsewhere. | 1164 // Handled elsewhere. |
| 1165 break; | 1165 break; |
| 1166 | 1166 |
| 1167 case ServiceEvent.kBreakpointAdded: | 1167 case ServiceEvent.kBreakpointAdded: |
| 1168 _addBreakpoint(event.breakpoint); | 1168 _addBreakpoint(event.breakpoint); |
| 1169 break; | 1169 break; |
| 1170 | 1170 |
| 1171 case ServiceEvent.kIsolateUpdate: | 1171 case ServiceEvent.kIsolateUpdate: |
| 1172 case ServiceEvent.kBreakpointResolved: | 1172 case ServiceEvent.kBreakpointResolved: |
| 1173 case ServiceEvent.kDebuggerUpdate: | |
| 1173 // Update occurs as side-effect of caching. | 1174 // Update occurs as side-effect of caching. |
| 1174 break; | 1175 break; |
| 1175 | 1176 |
| 1176 case ServiceEvent.kBreakpointRemoved: | 1177 case ServiceEvent.kBreakpointRemoved: |
| 1177 _removeBreakpoint(event.breakpoint); | 1178 _removeBreakpoint(event.breakpoint); |
| 1178 break; | 1179 break; |
| 1179 | 1180 |
| 1180 case ServiceEvent.kPauseStart: | 1181 case ServiceEvent.kPauseStart: |
| 1181 case ServiceEvent.kPauseExit: | 1182 case ServiceEvent.kPauseExit: |
| 1182 case ServiceEvent.kPauseBreakpoint: | 1183 case ServiceEvent.kPauseBreakpoint: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1258 } | 1259 } |
| 1259 | 1260 |
| 1260 Future stepOut() { | 1261 Future stepOut() { |
| 1261 return invokeRpc('resume', {'step': 'Out'}); | 1262 return invokeRpc('resume', {'step': 'Out'}); |
| 1262 } | 1263 } |
| 1263 | 1264 |
| 1264 Future setName(String newName) { | 1265 Future setName(String newName) { |
| 1265 return invokeRpc('setName', {'name': newName}); | 1266 return invokeRpc('setName', {'name': newName}); |
| 1266 } | 1267 } |
| 1267 | 1268 |
| 1269 Future getDebuggerUpdate() { | |
| 1270 return invokeRpc('_getDebuggerUpdate', {}); | |
| 1271 } | |
| 1272 | |
| 1273 Future setExceptionPauseInfo(String exceptions) { | |
| 1274 return invokeRpc('_setExceptionPauseInfo', {'exceptions': exceptions}); | |
| 1275 } | |
| 1276 | |
| 1268 Future<ServiceMap> getStack() { | 1277 Future<ServiceMap> getStack() { |
| 1269 return invokeRpc('getStack', {}); | 1278 return invokeRpc('getStack', {}); |
| 1270 } | 1279 } |
| 1271 | 1280 |
| 1272 Future<ServiceObject> _eval(ServiceObject target, | 1281 Future<ServiceObject> _eval(ServiceObject target, |
| 1273 String expression) { | 1282 String expression) { |
| 1274 Map params = { | 1283 Map params = { |
| 1275 'targetId': target.id, | 1284 'targetId': target.id, |
| 1276 'expression': expression, | 1285 'expression': expression, |
| 1277 }; | 1286 }; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1463 static const kPauseBreakpoint = 'PauseBreakpoint'; | 1472 static const kPauseBreakpoint = 'PauseBreakpoint'; |
| 1464 static const kPauseInterrupted = 'PauseInterrupted'; | 1473 static const kPauseInterrupted = 'PauseInterrupted'; |
| 1465 static const kPauseException = 'PauseException'; | 1474 static const kPauseException = 'PauseException'; |
| 1466 static const kResume = 'Resume'; | 1475 static const kResume = 'Resume'; |
| 1467 static const kBreakpointAdded = 'BreakpointAdded'; | 1476 static const kBreakpointAdded = 'BreakpointAdded'; |
| 1468 static const kBreakpointResolved = 'BreakpointResolved'; | 1477 static const kBreakpointResolved = 'BreakpointResolved'; |
| 1469 static const kBreakpointRemoved = 'BreakpointRemoved'; | 1478 static const kBreakpointRemoved = 'BreakpointRemoved'; |
| 1470 static const kGraph = '_Graph'; | 1479 static const kGraph = '_Graph'; |
| 1471 static const kGC = 'GC'; | 1480 static const kGC = 'GC'; |
| 1472 static const kInspect = 'Inspect'; | 1481 static const kInspect = 'Inspect'; |
| 1482 static const kDebuggerUpdate = '_DebuggerUpdate'; | |
| 1473 static const kConnectionClosed = 'ConnectionClosed'; | 1483 static const kConnectionClosed = 'ConnectionClosed'; |
| 1474 | 1484 |
| 1475 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner); | 1485 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 1476 | 1486 |
| 1477 ServiceEvent.connectionClosed(this.reason) : super._empty(null) { | 1487 ServiceEvent.connectionClosed(this.reason) : super._empty(null) { |
| 1478 kind = kConnectionClosed; | 1488 kind = kConnectionClosed; |
| 1479 } | 1489 } |
| 1480 | 1490 |
| 1481 @observable String kind; | 1491 @observable String kind; |
| 1482 @observable Breakpoint breakpoint; | 1492 @observable Breakpoint breakpoint; |
| 1483 @observable Frame topFrame; | 1493 @observable Frame topFrame; |
| 1484 @observable ServiceMap exception; | 1494 @observable Instance exception; |
| 1485 @observable ServiceObject inspectee; | 1495 @observable ServiceObject inspectee; |
| 1486 @observable ByteData data; | 1496 @observable ByteData data; |
| 1487 @observable int count; | 1497 @observable int count; |
| 1488 @observable String reason; | 1498 @observable String reason; |
| 1499 @observable String exceptions; | |
| 1489 int chunkIndex, chunkCount, nodeCount; | 1500 int chunkIndex, chunkCount, nodeCount; |
| 1490 | 1501 |
| 1491 @observable bool get isPauseEvent { | 1502 @observable bool get isPauseEvent { |
| 1492 return (kind == kPauseStart || | 1503 return (kind == kPauseStart || |
| 1493 kind == kPauseExit || | 1504 kind == kPauseExit || |
| 1494 kind == kPauseBreakpoint || | 1505 kind == kPauseBreakpoint || |
| 1495 kind == kPauseInterrupted || | 1506 kind == kPauseInterrupted || |
| 1496 kind == kPauseException); | 1507 kind == kPauseException); |
| 1497 } | 1508 } |
| 1498 | 1509 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1530 } | 1541 } |
| 1531 if (map['chunkCount'] != null) { | 1542 if (map['chunkCount'] != null) { |
| 1532 chunkCount = map['chunkCount']; | 1543 chunkCount = map['chunkCount']; |
| 1533 } | 1544 } |
| 1534 if (map['nodeCount'] != null) { | 1545 if (map['nodeCount'] != null) { |
| 1535 nodeCount = map['nodeCount']; | 1546 nodeCount = map['nodeCount']; |
| 1536 } | 1547 } |
| 1537 if (map['count'] != null) { | 1548 if (map['count'] != null) { |
| 1538 count = map['count']; | 1549 count = map['count']; |
| 1539 } | 1550 } |
| 1551 if (map['_exceptions'] != null) { | |
| 1552 exceptions = map['_exceptions']; | |
| 1553 } | |
| 1540 } | 1554 } |
| 1541 | 1555 |
| 1542 String toString() { | 1556 String toString() { |
| 1543 if (data == null) { | 1557 if (data == null) { |
| 1544 return "ServiceEvent(owner='${owner.id}', kind='${kind}')"; | 1558 return "ServiceEvent(owner='${owner.id}', kind='${kind}')"; |
| 1545 } else { | 1559 } else { |
| 1546 return "ServiceEvent(owner='${owner.id}', kind='${kind}', " | 1560 return "ServiceEvent(owner='${owner.id}', kind='${kind}', " |
| 1547 "data.lengthInBytes=${data.lengthInBytes})"; | 1561 "data.lengthInBytes=${data.lengthInBytes})"; |
| 1548 } | 1562 } |
| 1549 } | 1563 } |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2084 @observable Code unoptimizedCode; | 2098 @observable Code unoptimizedCode; |
| 2085 @observable bool isOptimizable; | 2099 @observable bool isOptimizable; |
| 2086 @observable bool isInlinable; | 2100 @observable bool isInlinable; |
| 2087 @observable FunctionKind kind; | 2101 @observable FunctionKind kind; |
| 2088 @observable int deoptimizations; | 2102 @observable int deoptimizations; |
| 2089 @observable String qualifiedName; | 2103 @observable String qualifiedName; |
| 2090 @observable int usageCounter; | 2104 @observable int usageCounter; |
| 2091 @observable bool isDart; | 2105 @observable bool isDart; |
| 2092 @observable ProfileFunction profile; | 2106 @observable ProfileFunction profile; |
| 2093 | 2107 |
| 2094 bool get canCache => true; | 2108 bool get canCache => !_id.startsWith(ServiceMap.objectIdRingPrefix); |
| 2095 bool get immutable => false; | 2109 bool get immutable => false; |
| 2096 | 2110 |
| 2097 ServiceFunction._empty(ServiceObject owner) : super._empty(owner); | 2111 ServiceFunction._empty(ServiceObject owner) : super._empty(owner); |
| 2098 | 2112 |
| 2099 void _update(ObservableMap map, bool mapIsRef) { | 2113 void _update(ObservableMap map, bool mapIsRef) { |
| 2100 name = map['name']; | 2114 name = map['name']; |
| 2101 vmName = (map.containsKey('vmName') ? map['vmName'] : name); | 2115 vmName = (map.containsKey('vmName') ? map['vmName'] : name); |
| 2102 | 2116 |
| 2103 _upgradeCollection(map, isolate); | 2117 _upgradeCollection(map, isolate); |
| 2104 | 2118 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2337 Set<CallSite> callSites = new Set<CallSite>(); | 2351 Set<CallSite> callSites = new Set<CallSite>(); |
| 2338 final lines = new ObservableList<ScriptLine>(); | 2352 final lines = new ObservableList<ScriptLine>(); |
| 2339 final _hits = new Map<int, int>(); | 2353 final _hits = new Map<int, int>(); |
| 2340 @observable String uri; | 2354 @observable String uri; |
| 2341 @observable String kind; | 2355 @observable String kind; |
| 2342 @observable int firstTokenPos; | 2356 @observable int firstTokenPos; |
| 2343 @observable int lastTokenPos; | 2357 @observable int lastTokenPos; |
| 2344 @observable int lineOffset; | 2358 @observable int lineOffset; |
| 2345 @observable int columnOffset; | 2359 @observable int columnOffset; |
| 2346 @observable Library library; | 2360 @observable Library library; |
| 2347 bool get canCache => true; | 2361 |
| 2362 bool get canCache => !_id.startsWith(ServiceMap.objectIdRingPrefix); | |
|
Cutch
2015/06/12 13:10:47
A better way to fix handle this:
Whenever an "id"
rmacnak
2015/06/15 17:53:51
Done.
| |
| 2348 bool get immutable => true; | 2363 bool get immutable => true; |
| 2349 | 2364 |
| 2350 String _shortUri; | 2365 String _shortUri; |
| 2351 | 2366 |
| 2352 Script._empty(ServiceObjectOwner owner) : super._empty(owner); | 2367 Script._empty(ServiceObjectOwner owner) : super._empty(owner); |
| 2353 | 2368 |
| 2354 ScriptLine getLine(int line) { | 2369 ScriptLine getLine(int line) { |
| 2355 assert(_loaded); | 2370 assert(_loaded); |
| 2356 assert(line >= 1); | 2371 assert(line >= 1); |
| 2357 return lines[line - lineOffset - 1]; | 2372 return lines[line - lineOffset - 1]; |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3247 void _update(ObservableMap map, bool mapIsRef) { | 3262 void _update(ObservableMap map, bool mapIsRef) { |
| 3248 assert(!mapIsRef); | 3263 assert(!mapIsRef); |
| 3249 _loaded = true; | 3264 _loaded = true; |
| 3250 _upgradeCollection(map, owner); | 3265 _upgradeCollection(map, owner); |
| 3251 this.index = map['index']; | 3266 this.index = map['index']; |
| 3252 this.function = map['function']; | 3267 this.function = map['function']; |
| 3253 this.location = map['location']; | 3268 this.location = map['location']; |
| 3254 this.code = map['code']; | 3269 this.code = map['code']; |
| 3255 this.variables = map['vars']; | 3270 this.variables = map['vars']; |
| 3256 } | 3271 } |
| 3272 | |
| 3273 String toString() => "Frame(${function.qualifiedName})"; | |
| 3257 } | 3274 } |
| 3258 | 3275 |
| 3259 | 3276 |
| 3260 class ServiceMessage extends ServiceObject { | 3277 class ServiceMessage extends ServiceObject { |
| 3261 @observable int index; | 3278 @observable int index; |
| 3262 @observable String messageObjectId; | 3279 @observable String messageObjectId; |
| 3263 @observable int size; | 3280 @observable int size; |
| 3264 @observable ServiceFunction handler; | 3281 @observable ServiceFunction handler; |
| 3265 @observable SourceLocation location; | 3282 @observable SourceLocation location; |
| 3266 | 3283 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3319 var v = list[i]; | 3336 var v = list[i]; |
| 3320 if ((v is ObservableMap) && _isServiceMap(v)) { | 3337 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 3321 list[i] = owner.getFromMap(v); | 3338 list[i] = owner.getFromMap(v); |
| 3322 } else if (v is ObservableList) { | 3339 } else if (v is ObservableList) { |
| 3323 _upgradeObservableList(v, owner); | 3340 _upgradeObservableList(v, owner); |
| 3324 } else if (v is ObservableMap) { | 3341 } else if (v is ObservableMap) { |
| 3325 _upgradeObservableMap(v, owner); | 3342 _upgradeObservableMap(v, owner); |
| 3326 } | 3343 } |
| 3327 } | 3344 } |
| 3328 } | 3345 } |
| OLD | NEW |