mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Provide isolate id for rpc request to ensure they are run on correct (UI) thread. (#17616)
This commit is contained in:
parent
2e24351fb1
commit
89cb5d268d
@ -905,7 +905,11 @@ class VM extends ServiceObjectOwner {
|
||||
if (!isFlutterEngine)
|
||||
return;
|
||||
_viewCache.clear();
|
||||
await vmService.vm.invokeRpc('_flutter.listViews', timeout: kLongRequestTimeout);
|
||||
for (Isolate isolate in isolates) {
|
||||
await vmService.vm.invokeRpc('_flutter.listViews',
|
||||
timeout: kLongRequestTimeout,
|
||||
params: <String, dynamic> {'isolateId': isolate.id});
|
||||
}
|
||||
}
|
||||
|
||||
Iterable<FlutterView> get views => _viewCache.values;
|
||||
@ -1393,6 +1397,7 @@ class FlutterView extends ServiceObject {
|
||||
assert(assetsDirectory != null);
|
||||
await owner.vmService.vm.invokeRpc('_flutter.setAssetBundlePath',
|
||||
params: <String, dynamic>{
|
||||
'isolateId': _uiIsolate.id,
|
||||
'viewId': id,
|
||||
'assetDirectory': assetsDirectory.toFilePath(windows: false)
|
||||
});
|
||||
@ -1401,7 +1406,8 @@ class FlutterView extends ServiceObject {
|
||||
bool get hasIsolate => _uiIsolate != null;
|
||||
|
||||
Future<Null> flushUIThreadTasks() async {
|
||||
await owner.vm.invokeRpcRaw('_flutter.flushUIThreadTasks');
|
||||
await owner.vm.invokeRpcRaw('_flutter.flushUIThreadTasks',
|
||||
params: <String, dynamic>{'isolateId': _uiIsolate.id});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user