From 9f295b93a8809678c7e56099e7bb63d9f8fca72b Mon Sep 17 00:00:00 2001 From: Mehmet Fidanboylu Date: Sat, 1 Aug 2020 08:43:17 -0700 Subject: [PATCH 1/2] Fix navigation message relay. --- shell/common/engine.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 1249615cf6d38..33b7a053df577 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -303,10 +303,6 @@ void Engine::DispatchPlatformMessage(fml::RefPtr message) { } else if (channel == kSettingsChannel) { HandleSettingsPlatformMessage(message.get()); return; - } else if (channel == kNavigationChannel) { - // If there's no runtime_, we may still need to set the initial route. - HandleNavigationPlatformMessage(std::move(message)); - return; } if (runtime_controller_->IsRootIsolateRunning() && @@ -314,6 +310,12 @@ void Engine::DispatchPlatformMessage(fml::RefPtr message) { return; } + if (channel == kNavigationChannel) { + // If there's no runtime_, we may still need to set the initial route. + HandleNavigationPlatformMessage(std::move(message)); + return; + } + FML_DLOG(WARNING) << "Dropping platform message on channel: " << channel; } From 6ec4662c4147fa97e5b25df6d4a7d643ec1c6ed8 Mon Sep 17 00:00:00 2001 From: Mehmet Fidanboylu Date: Sat, 1 Aug 2020 09:36:57 -0700 Subject: [PATCH 2/2] Check whether root isolate is running before sending navigation channel message to match old behavior: --- shell/common/engine.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 33b7a053df577..79f885dcbb7ce 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -303,6 +303,11 @@ void Engine::DispatchPlatformMessage(fml::RefPtr message) { } else if (channel == kSettingsChannel) { HandleSettingsPlatformMessage(message.get()); return; + } else if (!runtime_controller_->IsRootIsolateRunning() && + channel == kNavigationChannel) { + // If there's no runtime_, we may still need to set the initial route. + HandleNavigationPlatformMessage(std::move(message)); + return; } if (runtime_controller_->IsRootIsolateRunning() && @@ -310,12 +315,6 @@ void Engine::DispatchPlatformMessage(fml::RefPtr message) { return; } - if (channel == kNavigationChannel) { - // If there's no runtime_, we may still need to set the initial route. - HandleNavigationPlatformMessage(std::move(message)); - return; - } - FML_DLOG(WARNING) << "Dropping platform message on channel: " << channel; }