Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2079a8c

Browse files
[fuchsia][scenic] Call GetViewRef once per view in flatland platform (#36304)
view. Currently flatland platform view recursively calls GetViewRef to watch for ViewRef changes. Since re-linking of views will not be supported by flatland, GetViewRef should be called only once per view. Test: ffx test run "fuchsia-pkg://fuchsia.com/flutter_runner_tests#meta/flutter_runner_tests.cm" Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=109948
1 parent 0277668 commit 2079a8c

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

shell/platform/fuchsia/flutter/flatland_platform_view.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,6 @@ void FlatlandPlatformView::OnChildViewViewRef(
154154
fidl::Clone(view_ref, &view_ref_clone);
155155
pointer_injector_delegate_->OnCreateView(view_id, std::move(view_ref_clone));
156156
OnChildViewConnected(content_id);
157-
158-
// TODO(http://fxbug.dev/109948): Remove the following GetViewRef call.
159-
child_view_info_.at(content_id)
160-
.child_view_watcher->GetViewRef(
161-
[this, content_id, view_id](fuchsia::ui::views::ViewRef view_ref) {
162-
this->OnChildViewViewRef(content_id, view_id, std::move(view_ref));
163-
});
164157
}
165158

166159
void FlatlandPlatformView::OnCreateView(ViewCallback on_view_created,

shell/platform/fuchsia/flutter/tests/flatland_platform_view_unittest.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,7 @@ class MockChildViewWatcher
247247
// |fuchsia::ui::composition::ChildViewWatcher|
248248
void GetViewRef(GetViewRefCallback callback) override {
249249
// GetViewRef only returns once as per flatland.fidl comments
250-
if (control_ref_.reference) {
251-
return;
252-
}
250+
ASSERT_FALSE(control_ref_.reference);
253251
auto pair = scenic::ViewRefPair::New();
254252
control_ref_ = std::move(pair.control_ref);
255253
callback(std::move(pair.view_ref));

0 commit comments

Comments
 (0)