未验证 提交 daf1a27d 编写于 作者: G gaaclarke 提交者: GitHub

Started logging warnings if we drop platform messages. (#11792)

上级 766125b4
......@@ -261,13 +261,21 @@ void Window::UpdateAccessibilityFeatures(int32_t values) {
void Window::DispatchPlatformMessage(fml::RefPtr<PlatformMessage> message) {
std::shared_ptr<tonic::DartState> dart_state = library_.dart_state().lock();
if (!dart_state)
if (!dart_state) {
FML_DLOG(WARNING)
<< "Dropping platform message for lack of DartState on channel: "
<< message->channel();
return;
}
tonic::DartState::Scope scope(dart_state);
Dart_Handle data_handle =
(message->hasData()) ? ToByteData(message->data()) : Dart_Null();
if (Dart_IsError(data_handle))
if (Dart_IsError(data_handle)) {
FML_DLOG(WARNING)
<< "Dropping platform message because of a Dart error on channel: "
<< message->channel();
return;
}
int response_id = 0;
if (auto response = message->response()) {
......
......@@ -288,8 +288,13 @@ void Engine::DispatchPlatformMessage(fml::RefPtr<PlatformMessage> message) {
}
// If there's no runtime_, we may still need to set the initial route.
if (message->channel() == kNavigationChannel)
if (message->channel() == kNavigationChannel) {
HandleNavigationPlatformMessage(std::move(message));
return;
}
FML_DLOG(WARNING) << "Dropping platform message on channel: "
<< message->channel();
}
bool Engine::HandleLifecyclePlatformMessage(PlatformMessage* message) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册