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

Move platform specific information to PlatformConfiguration class #19652

Merged

Conversation

gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Jul 10, 2020

Description

This moves most of the logic that is currently in Window into a new PlatformConfiguration class, in preparation for multi-window support.

I split the platform specific configuration out of the Window class, into a separate PlatformConfiguration class that keeps the configuration of the platform, and manages a lot of the platform-specific communication that Window used to manage (things like DispatchPlatformMessage and UpdateLocales, etc.), since these things don't really belong in a window, they belong to the platform, and when you have more than one window, keeping them on each window doesn't make sense. The PlatformConfiguration class will connect to the PlatformDispatcher on the Dart side once that class exists.

Most of the new PlatformConfiguration class consists of methods moved verbatim from Window. I also renamed WindowData to PlatformData, since it no longer applies to windows. In the future, I'll be migrating the framework to match, so that there is a PlatformDispatcher class that takes care of communicating with PlatformConfiguration. [I didn't call them the same thing, because the engine side is meant to be the source of truth, and the framework side (once it exists) is meant to dispatch messages to and from this source of truth.]

Related Issues

Tests

  • Added tests for new platform configuration class.

@gspencergoog gspencergoog added the Work in progress (WIP) Not ready (yet) for review! label Jul 10, 2020
@gspencergoog gspencergoog force-pushed the platform_configuration branch 7 times, most recently from 4ded4dc to 658f5f9 Compare July 10, 2020 22:44
@gspencergoog gspencergoog force-pushed the platform_configuration branch 2 times, most recently from 3454662 to a72edab Compare July 14, 2020 02:03
@gspencergoog gspencergoog changed the title [WIP] Move platform specific information to PlatformConfiguration class Move platform specific information to PlatformConfiguration class Jul 15, 2020
@gspencergoog gspencergoog marked this pull request as ready for review July 15, 2020 19:04
@auto-assign auto-assign bot requested a review from jason-simmons July 15, 2020 19:05
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 really familiar with this part of the engine code, but the separation generally looks good to me.

@gspencergoog gspencergoog force-pushed the platform_configuration branch 8 times, most recently from e57cfdc to 184275c Compare July 21, 2020 23:45
@gspencergoog gspencergoog force-pushed the platform_configuration branch 2 times, most recently from 4e76459 to fd46d45 Compare July 23, 2020 20:41
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.

LGTM

@gspencergoog gspencergoog force-pushed the platform_configuration branch 3 times, most recently from 03d137f to ad1c965 Compare July 27, 2020 22:50
@chinmaygarde
Copy link
Member

Can we land this?

@gspencergoog
Copy link
Contributor Author

@chinmaygarde Yes, I was waiting for fixes to the lint errors in another PR (and the tree was all hosed for a while).

I'll try and land this today or tomorrow.

@gspencergoog gspencergoog force-pushed the platform_configuration branch 2 times, most recently from 9cbacc2 to b0b26f3 Compare July 30, 2020 22:16
@gspencergoog gspencergoog force-pushed the platform_configuration branch from b0b26f3 to 2b934c2 Compare July 31, 2020 18:13
@gspencergoog
Copy link
Contributor Author

Sorry, still trying to land this. I had to merge conflicts.

@gspencergoog gspencergoog added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jul 31, 2020
@fluttergithubbot fluttergithubbot merged commit 98cfd1d into flutter:master Aug 1, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2020
zanderso pushed a commit to flutter/flutter that referenced this pull request Aug 3, 2020
* 7f5d044 Wait before switching surfaces (flutter/engine#20100)

* 5513273 Reland: Avoid a copy in EncodeImage (flutter/engine#20003)

* 1efdd95 Roll Dart SDK from bd528bfbd69d to ea6bde577d1c (19 revisions) (flutter/engine#20172)

* 3b0e697 Roll Skia from 8cc118dce813 to c3794dd52778 (27 revisions) (flutter/engine#20173)

* cb1a374 Roll Fuchsia Mac SDK from T2xc0OuiK... to i0zTcQ8Qb... (flutter/engine#20175)

* ed36b1a Roll Skia from c3794dd52778 to 2d01ed94605a (10 revisions) (flutter/engine#20179)

* fcc1eaf Fix iOS Keyboard stuck as UIKeyboardTypeNamePhonePad (flutter/engine#20181)

* 9c6837c Roll Skia from 2d01ed94605a to 7225788b9070 (6 revisions) (flutter/engine#20183)

* 13e993e Fix Typos (flutter/engine#19691)

* 98cfd1d Move platform specific information to `PlatformConfiguration` class (flutter/engine#19652)

* 22fb58b update nullability of drawAtlas methods and flesh out docs (flutter/engine#20176)

* bcc43df Roll Dart SDK from ea6bde577d1c to 033a81d924b9 (23 revisions) (flutter/engine#20186)

* cb4bb93 [web] increase number of shards. sync engine web tests same as flutter repo (flutter/engine#20164)

* d986b8d Enable linting in several files (flutter/engine#20134)

* 7dd092d Enable more linting (flutter/engine#20187)

* 3cc86ac Roll Dart SDK from 033a81d924b9 to ad5bcf16f1c8 (9 revisions) (flutter/engine#20191)

* 5ca8a2a Roll Dart SDK from ad5bcf16f1c8 to d169af6f7d8f (1 revision) (flutter/engine#20192)

* 4de0c04 Roll Dart SDK from d169af6f7d8f to 7e6c55e3aaf5 (1 revision) (flutter/engine#20196)

* 908fe01 Fix navigation message relay. (flutter/engine#20193)

* f1b3b69 Roll Dart SDK from 7e6c55e3aaf5 to 365525432a70 (2 revisions) (flutter/engine#20197)

* 8fbdd3f Fix parameter names

* 083282e Fix Implments typo
Pragya007 pushed a commit to Pragya007/flutter that referenced this pull request Aug 11, 2020
* 7f5d044 Wait before switching surfaces (flutter/engine#20100)

* 5513273 Reland: Avoid a copy in EncodeImage (flutter/engine#20003)

* 1efdd95 Roll Dart SDK from bd528bfbd69d to ea6bde577d1c (19 revisions) (flutter/engine#20172)

* 3b0e697 Roll Skia from 8cc118dce813 to c3794dd52778 (27 revisions) (flutter/engine#20173)

* cb1a374 Roll Fuchsia Mac SDK from T2xc0OuiK... to i0zTcQ8Qb... (flutter/engine#20175)

* ed36b1a Roll Skia from c3794dd52778 to 2d01ed94605a (10 revisions) (flutter/engine#20179)

* fcc1eaf Fix iOS Keyboard stuck as UIKeyboardTypeNamePhonePad (flutter/engine#20181)

* 9c6837c Roll Skia from 2d01ed94605a to 7225788b9070 (6 revisions) (flutter/engine#20183)

* 13e993e Fix Typos (flutter/engine#19691)

* 98cfd1d Move platform specific information to `PlatformConfiguration` class (flutter/engine#19652)

* 22fb58b update nullability of drawAtlas methods and flesh out docs (flutter/engine#20176)

* bcc43df Roll Dart SDK from ea6bde577d1c to 033a81d924b9 (23 revisions) (flutter/engine#20186)

* cb4bb93 [web] increase number of shards. sync engine web tests same as flutter repo (flutter/engine#20164)

* d986b8d Enable linting in several files (flutter/engine#20134)

* 7dd092d Enable more linting (flutter/engine#20187)

* 3cc86ac Roll Dart SDK from 033a81d924b9 to ad5bcf16f1c8 (9 revisions) (flutter/engine#20191)

* 5ca8a2a Roll Dart SDK from ad5bcf16f1c8 to d169af6f7d8f (1 revision) (flutter/engine#20192)

* 4de0c04 Roll Dart SDK from d169af6f7d8f to 7e6c55e3aaf5 (1 revision) (flutter/engine#20196)

* 908fe01 Fix navigation message relay. (flutter/engine#20193)

* f1b3b69 Roll Dart SDK from 7e6c55e3aaf5 to 365525432a70 (2 revisions) (flutter/engine#20197)

* 8fbdd3f Fix parameter names

* 083282e Fix Implments typo
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
* 7f5d044 Wait before switching surfaces (flutter/engine#20100)

* 5513273 Reland: Avoid a copy in EncodeImage (flutter/engine#20003)

* 1efdd95 Roll Dart SDK from bd528bfbd69d to ea6bde577d1c (19 revisions) (flutter/engine#20172)

* 3b0e697 Roll Skia from 8cc118dce813 to c3794dd52778 (27 revisions) (flutter/engine#20173)

* cb1a374 Roll Fuchsia Mac SDK from T2xc0OuiK... to i0zTcQ8Qb... (flutter/engine#20175)

* ed36b1a Roll Skia from c3794dd52778 to 2d01ed94605a (10 revisions) (flutter/engine#20179)

* fcc1eaf Fix iOS Keyboard stuck as UIKeyboardTypeNamePhonePad (flutter/engine#20181)

* 9c6837c Roll Skia from 2d01ed94605a to 7225788b9070 (6 revisions) (flutter/engine#20183)

* 13e993e Fix Typos (flutter/engine#19691)

* 98cfd1d Move platform specific information to `PlatformConfiguration` class (flutter/engine#19652)

* 22fb58b update nullability of drawAtlas methods and flesh out docs (flutter/engine#20176)

* bcc43df Roll Dart SDK from ea6bde577d1c to 033a81d924b9 (23 revisions) (flutter/engine#20186)

* cb4bb93 [web] increase number of shards. sync engine web tests same as flutter repo (flutter/engine#20164)

* d986b8d Enable linting in several files (flutter/engine#20134)

* 7dd092d Enable more linting (flutter/engine#20187)

* 3cc86ac Roll Dart SDK from 033a81d924b9 to ad5bcf16f1c8 (9 revisions) (flutter/engine#20191)

* 5ca8a2a Roll Dart SDK from ad5bcf16f1c8 to d169af6f7d8f (1 revision) (flutter/engine#20192)

* 4de0c04 Roll Dart SDK from d169af6f7d8f to 7e6c55e3aaf5 (1 revision) (flutter/engine#20196)

* 908fe01 Fix navigation message relay. (flutter/engine#20193)

* f1b3b69 Roll Dart SDK from 7e6c55e3aaf5 to 365525432a70 (2 revisions) (flutter/engine#20197)

* 8fbdd3f Fix parameter names

* 083282e Fix Implments typo
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes 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.

5 participants