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

Conversation

@blasten
Copy link

@blasten blasten commented Jan 15, 2022

Fixes flutter/flutter#96661

I have a pending PR that refactors the external_view_embedder, and makes testing this situation easier.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not at all familiar with this code, and threading details can be subtle; surely there's a better reviewer for this?

@blasten blasten requested a review from cyanglaz January 18, 2022 19:11
// The platform view embedder may keep these surfaces even after the lease have expired in
// case they are used in a future frame that contains platform views.
//
// This is particularly an issue when a "cached" engine is used. In this case, this method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits:
When I read this, I don't know what it means by "cached" engine. Maybe we can add a reference link to an issue or something to explain it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's mention down below that FlutterEngineCache is a good place to look at.

@blasten blasten requested a review from cyanglaz January 20, 2022 03:56
@blasten blasten force-pushed the teardown_before_unmerge branch from e292770 to 20250bc Compare January 20, 2022 03:59
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding synchronous waits in the embedder (like the one added in runOnLooper) makes threading hard to reason about. There are a few places this happens in the engine and even in that localized context, it is tricky. Please don't lean into this anti-pattern by adding a convenience method for this (runOnLooper). I believe this can be handled in the engine itself. Perhaps the pool needs to be notified (via barriers) maybe that the thread configuration is about to be swapped?

@blasten
Copy link
Author

blasten commented Jan 22, 2022

I updated the PR to reuse the APIs available in the engine. PTAL

@blasten blasten requested a review from chinmaygarde January 22, 2022 00:19
Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ColdPaleLight added a commit to ColdPaleLight/engine that referenced this pull request Jan 27, 2022
zanderso pushed a commit that referenced this pull request Jan 27, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 27, 2022
blasten pushed a commit to blasten/engine that referenced this pull request Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Platform views throw fatal exception: Methods marked with @UiThread must be executed on the main thread

5 participants