未验证 提交 39c46dea 编写于 作者: G Gary Qian 提交者: GitHub

Revert "Buffer lifecycle in WindowData (#7999)" (#8010)

This reverts commit 0b174017.
上级 293cfcaa
......@@ -89,13 +89,6 @@ void _updateUserSettingsData(String jsonData) {
_updatePlatformBrightness(data['platformBrightness']);
}
@pragma('vm:entry-point')
// ignore: unused_element
void _updateLifecycleState(String state) {
window._initialLifecycleState ??= state;
}
void _updateTextScaleFactor(double textScaleFactor) {
window._textScaleFactor = textScaleFactor;
_invoke(window.onTextScaleFactorChanged, window._onTextScaleFactorChangedZone);
......
......@@ -556,15 +556,6 @@ class Window {
_onLocaleChangedZone = Zone.current;
}
/// The lifecycle state immediately after dart isolate initialization.
///
/// This property will not be updated as the lifecycle changes.
///
/// It is used to initialize [SchedulerBinding.lifecycleState] at startup
/// with any buffered lifecycle state events.
String get initialLifecycleState => _initialLifecycleState;
String _initialLifecycleState;
/// The system-reported text scale.
///
/// This establishes the text scaling factor to use when rendering text,
......
......@@ -217,18 +217,6 @@ void Window::UpdateUserSettingsData(const std::string& data) {
}));
}
void Window::UpdateLifecycleState(const std::string& data) {
std::shared_ptr<tonic::DartState> dart_state = library_.dart_state().lock();
if (!dart_state)
return;
tonic::DartState::Scope scope(dart_state);
tonic::LogIfError(tonic::DartInvokeField(library_.value(),
"_updateLifecycleState",
{
tonic::StdStringToDart(data),
}));
}
void Window::UpdateSemanticsEnabled(bool enabled) {
std::shared_ptr<tonic::DartState> dart_state = library_.dart_state().lock();
if (!dart_state)
......
......@@ -65,7 +65,6 @@ class Window final {
void UpdateWindowMetrics(const ViewportMetrics& metrics);
void UpdateLocales(const std::vector<std::string>& locales);
void UpdateUserSettingsData(const std::string& data);
void UpdateLifecycleState(const std::string& data);
void UpdateSemanticsEnabled(bool enabled);
void UpdateAccessibilityFeatures(int32_t flags);
void DispatchPlatformMessage(fml::RefPtr<PlatformMessage> message);
......
......@@ -128,8 +128,7 @@ bool RuntimeController::FlushRuntimeStateToIsolate() {
SetLocales(window_data_.locale_data) &&
SetSemanticsEnabled(window_data_.semantics_enabled) &&
SetAccessibilityFeatures(window_data_.accessibility_feature_flags_) &&
SetUserSettingsData(window_data_.user_settings_data) &&
SetLifecycleState(window_data_.lifecycle_state);
SetUserSettingsData(window_data_.user_settings_data);
}
bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) {
......@@ -165,17 +164,6 @@ bool RuntimeController::SetUserSettingsData(const std::string& data) {
return false;
}
bool RuntimeController::SetLifecycleState(const std::string& data) {
window_data_.lifecycle_state = data;
if (auto* window = GetWindowIfAvailable()) {
window->UpdateLifecycleState(window_data_.lifecycle_state);
return true;
}
return false;
}
bool RuntimeController::SetSemanticsEnabled(bool enabled) {
window_data_.semantics_enabled = enabled;
......
......@@ -49,8 +49,6 @@ class RuntimeController final : public WindowClient {
bool SetUserSettingsData(const std::string& data);
bool SetLifecycleState(const std::string& data);
bool SetSemanticsEnabled(bool enabled);
bool SetAccessibilityFeatures(int32_t flags);
......@@ -113,7 +111,6 @@ class RuntimeController final : public WindowClient {
std::string variant_code;
std::vector<std::string> locale_data;
std::string user_settings_data = "{}";
std::string lifecycle_state;
bool semantics_enabled = false;
bool assistive_technology_enabled = false;
int32_t accessibility_feature_flags_ = 0;
......
......@@ -291,8 +291,6 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) {
if (state == "AppLifecycleState.resumed" && have_surface_) {
ScheduleFrame();
}
runtime_controller_->SetLifecycleState(state);
// We always want pass the message forwards directly into the framework.
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册