servo/components
bors-servo bf667677f7
Auto merge of #20480 - kwonoj:refactor-file-manager, r=paulrouget
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 -->
2018-04-29 03:57:46 -04:00
..
allocator Fork the jemallocator crate, fix for nightly-2018-04-15 2018-04-16 08:56:08 +02:00
atoms Implement history state 2018-04-16 10:21:15 -05:00
bluetooth refactor(bluetooth): uses embedderproxy directly 2018-04-18 11:39:33 -07:00
bluetooth_traits delegate resource reading to embedder 2018-04-27 15:34:52 +08:00
canvas Auto merge of #20631 - brainlessdeveloper:add-webgl-get-renderbuffer-parameter, r=emilio 2018-04-25 04:18:38 -04:00
canvas_traits Auto merge of #20631 - brainlessdeveloper:add-webgl-get-renderbuffer-parameter, r=emilio 2018-04-25 04:18:38 -04:00
compositing refactor(embedder): rename file select message 2018-04-27 12:23:26 -07:00
config delegate resource reading to embedder 2018-04-27 15:34:52 +08:00
constellation refactor(filemanager): uses embedderproxy directly 2018-04-27 12:23:25 -07:00
debugger Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
deny_public_fields Update Webrender 2018-04-25 10:25:21 +02:00
devtools Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
devtools_traits Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
dom_struct Upgrade to rustc 1.27.0-nightly (056f589fb 2018-04-07) 2018-04-09 21:43:25 +02:00
domobject_derive Update Webrender 2018-04-25 10:25:21 +02:00
embedder_traits delegate resource reading to embedder 2018-04-27 15:34:52 +08:00
fallible Update smallvec to 0.6 2017-12-05 12:03:20 +01:00
geometry alias some euclid types 2018-03-16 14:34:29 +08:00
gfx Auto merge of #20420 - pyfisch:corner-clipping, r=emilio 2018-04-29 02:30:16 -04:00
gfx_traits Update WebRender 2018-02-06 15:10:35 +01:00
hashglobe Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
jstraceable_derive Update Webrender 2018-04-25 10:25:21 +02:00
layout Auto merge of #20420 - pyfisch:corner-clipping, r=emilio 2018-04-29 02:30:16 -04:00
layout_thread Auto merge of #20420 - pyfisch:corner-clipping, r=emilio 2018-04-29 02:30:16 -04:00
layout_traits Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
malloc_size_of Update to smallbitvec 2.1 2018-04-17 17:24:54 -07:00
malloc_size_of_derive Update Webrender 2018-04-25 10:25:21 +02:00
metrics added spec comments 2018-04-11 21:29:03 +01:00
msg Notify the embedder when it should display or hide an IME 2018-04-21 19:46:42 -07:00
net test(net): update test cases 2018-04-27 12:25:18 -07:00
net_traits delegate resource reading to embedder 2018-04-27 15:34:52 +08:00
nonzero Use new std::num::NonZero* types instead of deprecated core::nonzero::NonZero 2018-04-09 21:43:26 +02:00
profile Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
profile_traits Measure cache memory usage (#19251): 2018-04-01 13:30:57 -04:00
rand Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
range Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
remutex Use new std::num::NonZero* types instead of deprecated core::nonzero::NonZero 2018-04-09 21:43:26 +02:00
script Auto merge of #20533 - paulrouget:res, r=mbrubeck 2018-04-27 13:50:18 -04:00
script_layout_interface Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
script_plugins Make the unrooted_must_root conditional on a default Cargo feature. 2017-11-02 15:08:04 +01:00
script_traits refactor(filemanager): uses embedderproxy directly 2018-04-27 12:23:25 -07:00
selectors Run rustfmt on selectors, servo_arc, and style. 2018-04-10 17:35:15 -07:00
servo refactor(filemanager): uses embedderproxy directly 2018-04-27 12:23:25 -07:00
servo_arc style: Fix tidy issues and Servo build. 2018-04-29 05:09:43 +02:00
size_of_test
style style: Fix tidy issues and Servo build. 2018-04-29 05:09:43 +02:00
style_derive style: Fix tidy issues and Servo build. 2018-04-29 05:09:43 +02:00
style_traits style: Fix tidy issues and Servo build. 2018-04-29 05:09:43 +02:00
url Fix building servo_url by itself 2018-04-19 17:01:14 +02:00
webdriver_server Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
webvr Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
webvr_traits Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00