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

[Windows] Refactor client wrapper to prepare for multi-view #52073

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Apr 11, 2024

This is a refactoring with no semantic changes. No new public APIs are introduced by this change.

In the future, a new constructor will be added to FlutterViewController to allow it to use an existing std::shared_ptr<FlutterEngine> to create the view controller. This updates FlutterViewController to store a std::shared_ptr and other minor tweaks.

For context, we plan to not land the new multi-window FlutterViewController constructor until Window's multi-window support is productionized. Until then, we will maintain a patch for folks that want to experiment with multi-window. This change makes that patch as small as possible.

Design doc: flutter.dev/go/desktop-multi-view-runner-apis

Part of flutter/flutter#143767
Part of flutter/flutter#142845

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

// Whether the engine has been run. This will be true if Run has been called,
// or if RelinquishEngine has been called (since the view controller will
// run the engine if it hasn't already been run).
bool has_been_run_ = false;
Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated the comment and renamed this to run_succeeded_ to reflect its current purpose better.

This comment was incorrect when it was added. See: cd4192d#diff-4d73a4226c049b829de25c009bf79a1d30674d639e9c5c23f7e508690f68d6aaR73

@loic-sharma loic-sharma marked this pull request as draft April 12, 2024 00:26
@loic-sharma
Copy link
Member Author

Converted back to draft as this change needs a little work. Apologies for the noise.

@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

@loic-sharma loic-sharma force-pushed the windows_refactor_wrapper branch from df833ab to 7e04539 Compare April 12, 2024 00:46
@loic-sharma loic-sharma marked this pull request as ready for review April 12, 2024 00:48
Copy link
Contributor

@yaakovschectman yaakovschectman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

LGTM stamp from a Japanese personal seal

@Hixie
Copy link
Contributor

Hixie commented Apr 12, 2024

test-exempt: code refactor with no semantic change

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 12, 2024
@auto-submit auto-submit bot merged commit b32363e into flutter:main Apr 12, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 15, 2024
…146775)

flutter/engine@1a13c7d...84238c4

2024-04-15 [email protected] [scenarios] test disabling surface clear. (flutter/engine#52128)
2024-04-12 [email protected] Roll Dart SDK from 3d13dbfb3284 to ac31be3c8546 (8 revisions) (flutter/engine#52084)
2024-04-12 [email protected] Roll Skia from 761f6f7f6250 to 9e20a146c024 (7 revisions) (flutter/engine#52085)
2024-04-12 [email protected] [Windows] Refactor client wrapper to prepare for multi-view (flutter/engine#52073)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gilnobrega pushed a commit to gilnobrega/flutter that referenced this pull request Apr 22, 2024
…lutter#146775)

flutter/engine@1a13c7d...84238c4

2024-04-15 [email protected] [scenarios] test disabling surface clear. (flutter/engine#52128)
2024-04-12 [email protected] Roll Dart SDK from 3d13dbfb3284 to ac31be3c8546 (8 revisions) (flutter/engine#52084)
2024-04-12 [email protected] Roll Skia from 761f6f7f6250 to 9e20a146c024 (7 revisions) (flutter/engine#52085)
2024-04-12 [email protected] [Windows] Refactor client wrapper to prepare for multi-view (flutter/engine#52073)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects: desktop autosubmit Merge PR when tree becomes green via auto submit App platform-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants