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

Conversation

@stuartmorgan-g
Copy link
Contributor

Description

The Windows embedding was based on the GLFW embedding, which grew
organically from a singe-file implementation that used structs to manage
all of the important state. It is in the process of being converted to a
cleaner object-based architecture, but currently it is a hybrid of
objects and structs that have redundant data, making it very prone to
errors of forgetting to update pointers in multiple locations.

This reduces the remaining structs to only a single pointer to the
larger object that manages the responsibilities that handle is
associated with, so that there is no need to wire things together in
multiple places.

For now they continue to exist as projections of the larger objects, but
that will be eliminated over time by having an object structure that
better reflects the API structure.

Related Issues

Fixes flutter/flutter#64250

Tests

I added the following tests: None. (Testing backfill for this embedding will be a late-Q3/Q4 priority.)

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the contributor guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the C++, Objective-C, Java style guides for the engine.
  • I read the tree hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change.

The Windows embedding was based on the GLFW embedding, which grew
organically from a singe-file implementation that used structs to manage
all of the important state. It is in the process of being converted to a
cleaner object-based architecture, but currently it is a hybrid of
objects and structs that have redundant data, making it very prone to
errors of forgetting to update pointers in multiple locations.

This reduces the remaining structs to only a single pointer to the
larger object that manages the responsibilities that handle is
associated with, so that there is no need to wire things together in
multiple places.

For now they continue to exist as projections of the larger objects, but
that will be eliminated over time by having an object structure that
better reflects the API structure.

Fixes flutter/flutter#64250
@hamdikahloun
Copy link
Member

@stuartmorgan

../../flutter/shell/platform/embedder/embedder.cc (1360): 'FlutterEngineSendPlatformMessage' returned 'kInvalidArguments'. Invalid engine handle.

[√] Flutter (Channel master, 1.21.0-10.0.pre.212, on Microsoft Windows [Version 10.0.19041.264], locale en-US)
• Flutter version 1.21.0-10.0.pre.212 at C:\Users\Flutter\Documents\flutter
• Framework revision eef4220 (10 hours ago), 2020-08-20 17:46:07 -0700
• Engine revision 4dc8662
• Dart version 2.10.0 (build 2.10.0-45.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\Flutter\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.2)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.7.30413.136
• Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (1 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19041.264]

• No issues found!

@stuartmorgan-g
Copy link
Contributor Author

I'm not sure what the purpose of your comment is; I'm obviously aware of the bug this PR fixed given that it's referenced in the PR description.

@hamdikahloun
Copy link
Member

hamdikahloun commented Aug 21, 2020

I just mentioned that I upgraded to new version and it's not fixed yet.

@stuartmorgan-g
Copy link
Contributor Author

Engine revision 4dc8662

Since your engine version is older than this fix, it would be surprising if it were fixed.

@hamdikahloun
Copy link
Member

Sure 😃
Thank you @stuartmorgan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'FlutterEngineSendPlatformMessage' returned 'kInvalidArguments'

5 participants