Unverified Commit 89cb5d26 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Provide isolate id for rpc request to ensure they are run on correct (UI) thread. (#17616)

parent 2e24351f
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment