mirror of
https://github.com/servo/servo.git
synced 2025-08-01 03:30:33 +01:00
refactor(net): removes direct ui invocation from filemgr thread <!-- Please describe your changes on the following line: --> - relates to https://github.com/servo/servo/issues/20428. This PR tries to refactor `net::filemanager_thread` implementation, removes direct ui-related code invocation but ask constellation. I believe overall organization might need to be refactored still as I took my own liberty to wire up dots and dots between components, which could be non-recommended practices. Probably point of review / need to be updated are 1. Communication between components Currently it's wired as like below: ``` +----------------+ +---------------+ +---------+ | | constellationMsg | | embedderMsg | | | filemgr_thread +------------------->+ constellation +------------->+ browser | | | | | | | +-----+----------+ +---------------+ +----+----+ ^ | +-------------------------------------------------------------------+ filelist: Vec(String) ``` - is this feasible approach? - does organization of message / fn (where to put consteallation / embedder msg & fns) are legit? 2. Removal of `filemanger_thread::UIProvider` - As filemanager_thread no longer need to aware actual ui, this PR removes `UIProvider` completely and let invoke tinyfiledialog directly in message listener. Maybe UIProvider itself still being needed? 3. Overall fn organization - To reduce duplicated code it takes single msg with boolean flag to distinguish selecting multiple files, may feasible / or better to create explicit paths between two. 4. Invoking tfd in a separate thread - This was mainly to align behavior to previous implentation, where tfd was invoked inside of filemanager_thread so does not block main. It may possibly just let block instead. and of course, a lot of other codes need to follow better practices. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #20428 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ - Manually verified file picker `<input type=files>` can pick up files. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20480) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
geckolib | ||
servo |