mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +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 --> |
||
---|---|---|
.. | ||
allocator | ||
atoms | ||
bluetooth | ||
bluetooth_traits | ||
canvas | ||
canvas_traits | ||
compositing | ||
config | ||
constellation | ||
debugger | ||
deny_public_fields | ||
devtools | ||
devtools_traits | ||
dom_struct | ||
domobject_derive | ||
embedder_traits | ||
fallible | ||
geometry | ||
gfx | ||
gfx_traits | ||
hashglobe | ||
jstraceable_derive | ||
layout | ||
layout_thread | ||
layout_traits | ||
malloc_size_of | ||
malloc_size_of_derive | ||
metrics | ||
msg | ||
net | ||
net_traits | ||
nonzero | ||
profile | ||
profile_traits | ||
rand | ||
range | ||
remutex | ||
script | ||
script_layout_interface | ||
script_plugins | ||
script_traits | ||
selectors | ||
servo | ||
servo_arc | ||
size_of_test | ||
style | ||
style_derive | ||
style_traits | ||
url | ||
webdriver_server | ||
webvr | ||
webvr_traits |