Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracts the process handling out of the splash controller #233

Merged
merged 5 commits into from
Jul 21, 2022

Conversation

CarlosNihelton
Copy link
Collaborator

The splash controller is made of a state machine and a strategy class full of static functions to encapsulate the Win32 API's with the duty of starting and controlling the slide show application. There are a few premises related to its job:

  1. Launcher output stream must be succefully redirected so the child process can read it and display the messages.
  2. The Flutter executable must exist.
  3. Starting the application must succeed.
  4. Detecting its HWND also succeeds.

It's quite easy to predict that the behavior of that class could be a nightmare of if-elses. That's why the state machine design.

Yet, the strategy class that feeds the controller with the Win32 capabilities is doing too much: controlling the application process and the application window. When porting the OOBE to Windows, most of the process handling behavior would be duplicated, but the window control would not, thus splitting those duties in two different components allows for an easier migration to the new OOBE while not breaking the current behavior (required for the upcoming point release).

So, this PR extracts the process creation, termination and spurious termination notification out of the splash controller component. Also, the splash controller is updated to reflect the changes in such a way that user won't notice any difference in the application behavior.

Like GUI ones, notifying when the process exit.
Leaving only the window management.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Please check out carefully the isses found by clang-tidy in the new code ⚠️
⚠️ clang-format found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)

DistroLauncher/ChildProcess.h Show resolved Hide resolved
DistroLauncher/ChildProcess.h Outdated Show resolved Hide resolved
DistroLauncher/splash_controller.h Outdated Show resolved Hide resolved
DistroLauncher/splash_controller.h Outdated Show resolved Hide resolved
@CarlosNihelton CarlosNihelton marked this pull request as ready for review July 20, 2022 15:16
@EduardGomezEscandell
Copy link
Collaborator

Requesting changes only for the typo 😄. The others are more debatable.

Removed the using declaration in the namespace scope on ChildProcess.
SplashController now accepts the ProcessAPI type parameter.
Copy link
Collaborator

@EduardGomezEscandell EduardGomezEscandell left a comment

Choose a reason for hiding this comment

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

I see that my "Abstract" and "Usage" comments have become a thing 😄

@CarlosNihelton CarlosNihelton merged commit f197bc1 into main Jul 21, 2022
@CarlosNihelton CarlosNihelton deleted the child-process-deeng-337 branch July 21, 2022 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants