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 /// 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 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1107 params['isolateId'] = id; | 1107 params['isolateId'] = id; |
1108 return vm.invokeRpcNoUpgrade(method, params); | 1108 return vm.invokeRpcNoUpgrade(method, params); |
1109 } | 1109 } |
1110 | 1110 |
1111 Future<ServiceObject> invokeRpc(String method, Map params) { | 1111 Future<ServiceObject> invokeRpc(String method, Map params) { |
1112 return invokeRpcNoUpgrade(method, params).then((ObservableMap response) { | 1112 return invokeRpcNoUpgrade(method, params).then((ObservableMap response) { |
1113 return getFromMap(response); | 1113 return getFromMap(response); |
1114 }); | 1114 }); |
1115 } | 1115 } |
1116 | 1116 |
1117 Future<ServiceObject> getObject(String objectId) { | 1117 Future<ServiceObject> getObject(String objectId, {bool reload: true}) { |
Cutch
2015/08/13 13:43:13
Not used but I added it while trying something out
| |
1118 assert(objectId != null && objectId != ''); | 1118 assert(objectId != null && objectId != ''); |
1119 var obj = _cache[objectId]; | 1119 var obj = _cache[objectId]; |
1120 if (obj != null) { | 1120 if (obj != null) { |
1121 return obj.reload(); | 1121 if (reload) { |
1122 return obj.reload(); | |
1123 } | |
1124 // Returned cached object. | |
1125 return new Future.value(obj); | |
1122 } | 1126 } |
1123 Map params = { | 1127 Map params = { |
1124 'objectId': objectId, | 1128 'objectId': objectId, |
1125 }; | 1129 }; |
1126 return isolate.invokeRpc('getObject', params); | 1130 return isolate.invokeRpc('getObject', params); |
1127 } | 1131 } |
1128 | 1132 |
1129 Future<ObservableMap> _fetchDirect() { | 1133 Future<ObservableMap> _fetchDirect() { |
1130 return invokeRpcNoUpgrade('getIsolate', {}); | 1134 return invokeRpcNoUpgrade('getIsolate', {}); |
1131 } | 1135 } |
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2379 @observable bool isOptimizable; | 2383 @observable bool isOptimizable; |
2380 @observable bool isInlinable; | 2384 @observable bool isInlinable; |
2381 @observable FunctionKind kind; | 2385 @observable FunctionKind kind; |
2382 @observable int deoptimizations; | 2386 @observable int deoptimizations; |
2383 @observable String qualifiedName; | 2387 @observable String qualifiedName; |
2384 @observable int usageCounter; | 2388 @observable int usageCounter; |
2385 @observable bool isDart; | 2389 @observable bool isDart; |
2386 @observable ProfileFunction profile; | 2390 @observable ProfileFunction profile; |
2387 @observable Instance icDataArray; | 2391 @observable Instance icDataArray; |
2388 | 2392 |
2393 bool get canCache => true; | |
2389 bool get immutable => false; | 2394 bool get immutable => false; |
2390 | 2395 |
2391 ServiceFunction._empty(ServiceObject owner) : super._empty(owner); | 2396 ServiceFunction._empty(ServiceObject owner) : super._empty(owner); |
2392 | 2397 |
2393 void _update(ObservableMap map, bool mapIsRef) { | 2398 void _update(ObservableMap map, bool mapIsRef) { |
2394 name = map['name']; | 2399 name = map['name']; |
2395 vmName = (map.containsKey('vmName') ? map['vmName'] : name); | 2400 vmName = (map.containsKey('vmName') ? map['vmName'] : name); |
2396 | 2401 |
2397 _upgradeCollection(map, isolate); | 2402 _upgradeCollection(map, isolate); |
2398 | 2403 |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3700 var v = list[i]; | 3705 var v = list[i]; |
3701 if ((v is ObservableMap) && _isServiceMap(v)) { | 3706 if ((v is ObservableMap) && _isServiceMap(v)) { |
3702 list[i] = owner.getFromMap(v); | 3707 list[i] = owner.getFromMap(v); |
3703 } else if (v is ObservableList) { | 3708 } else if (v is ObservableList) { |
3704 _upgradeObservableList(v, owner); | 3709 _upgradeObservableList(v, owner); |
3705 } else if (v is ObservableMap) { | 3710 } else if (v is ObservableMap) { |
3706 _upgradeObservableMap(v, owner); | 3711 _upgradeObservableMap(v, owner); |
3707 } | 3712 } |
3708 } | 3713 } |
3709 } | 3714 } |
OLD | NEW |