From 2d74bd4c274868e99595a4a09385e681477b5760 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Wed, 16 May 2018 07:29:20 -0700 Subject: [PATCH] Enable flutter service protocol rpcs to run on UI isolate. (flutter/engine#5263) With this change if flutter tools provides isolateId parameter, then VM will run the handler on that isolate. If no isolateId is provided, VM will continue running handlers as if they were registered wit Dart_RegisterRootServiceRequestCallback. This goes towards fixing https://github.com/flutter/flutter/issues/17434 --- engine/src/flutter/runtime/service_protocol.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/runtime/service_protocol.cc b/engine/src/flutter/runtime/service_protocol.cc index f2960d624d..3994b78ef3 100644 --- a/engine/src/flutter/runtime/service_protocol.cc +++ b/engine/src/flutter/runtime/service_protocol.cc @@ -63,7 +63,7 @@ void ServiceProtocol::RemoveHandler(Handler* handler) { void ServiceProtocol::ToggleHooks(bool set) { for (const auto& endpoint : endpoints_) { - Dart_RegisterRootServiceRequestCallback( + Dart_RegisterIsolateServiceRequestCallback( endpoint.data(), // method &ServiceProtocol::HandleMessage, // callback set ? this : nullptr // user data