Граф коммитов

21 Коммитов

Автор SHA1 Сообщение Дата
Ms2ger db3e1b39e3 servo: Merge #14831 - Rustfmt script_traits and net_traits (from servo:rustfmt-traits); r=nox
CC #8553.

Source-Repo: https://github.com/servo/servo
Source-Revision: 68ecb0484739ffacc4e76b4cbf54bcf20e5cca2b
2017-01-03 08:11:09 -08:00
Zhen Zhang 523e8340d7 servo: Merge #12898 - Burn SelectedFileId in fire (from izgzhen:burn-selected-file-id); r=Manishearth
r? @Manishearth

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

Source-Repo: https://github.com/servo/servo
Source-Revision: 43d4a459c0080215de10f43ea74b7860fb196009
2016-08-22 03:09:28 -05:00
Zhen Zhang b6ef5dece1 servo: Merge #12897 - Improve File API related comments (from izgzhen:improve-file-api-comments); r=Manishearth
r? @Manishearth

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

Source-Repo: https://github.com/servo/servo
Source-Revision: f4f212fd18290eab51eaac972335cec60d2a34e0
2016-08-17 06:38:34 -05:00
Zhen Zhang 40d490b7e6 servo: Merge #12684 - Add cancellability to file manager load and related refactoring (from izgzhen:cancel-file-manager); r=Manishearth
Fixes #12589.

r? @Manishearth

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #12589
- [x] There are tests for these changes OR

Source-Repo: https://github.com/servo/servo
Source-Revision: b2f69f363574d5dea3cb96d4ef00c1d4e56bdd63
2016-08-02 16:57:46 -05:00
Zhen Zhang 118195615b servo: Merge #12579 - Fix FileAPI's refcount implementation (from izgzhen:fix-fileapi-ref); r=Manishearth
Revise several intricate parts of FileAPI's internal refcounting-related implementation.

Goal: Get it done right once and for all.

r? @Manishearth

<!-- Please describe your changes on the following line: -->

---
<!-- 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 do not require tests because it is internal logic change

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 93b130f3f7571ebb7407e3914d83dc6fc526c7d4
2016-08-02 03:03:47 -05:00
Zhen Zhang 8a84b8355b servo: Merge #12577 - Chunked ReadFile from file manager (from izgzhen:fm-chunked); r=Manishearth
+ Introduce a `ReadFileProgress` sender in the `ReadFile` msg to file manager, and implement the related I/O operations
+ Change `tests/unit/net/test.jpeg` from a 4.8K file to a 39K file to better test the chunked reading (Since one chunk is maximally 8129 Bytes).

r? @Manishearth

<!-- Please describe your changes on the following line: -->

---
<!-- 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] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: b41bf4f1f30b8f4eec92909c8971bc02d5422b50
2016-07-26 02:42:45 -05:00
Zhen Zhang 843baeffe9 servo: Merge #12440 - Put Blob URL online (from izgzhen:blob-online); r=Manishearth
This PR connects the resource requests with file manager thread, including:

+ `script_thread` load request
+ `image_cache_thread` load request
+ XHR load request (the responding part code yet not implemented due to unfamiliarity with fetch standard, but the infra is here)

One notable change is the introduction of "long-live validity", to handle the case specified in WPT test FileAPI/blob/Blob-XHR-revoke.html.

r? @Manishearth

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #10539
- [x] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 0e5893dc0d66faaca1c16101aa1f04a6cfb0b9c1
2016-07-15 06:39:23 -07:00
Zhen Zhang f66935aba8 servo: Merge #12406 - Refactor FileAPI implementation (from izgzhen:refactor-file); r=Manishearth
Most are simple refactoring, cleanups and improvements, but still involving two slightly notable changes:

+ In `filemanager`, now we read the file content based on requested `RelativePos` by `seek` and `read_exact` (rather than `read_to_end` then do slicing). This strategy might be again adjusted in future performance tuning but certainly better than nothing.
+ Also, I cached more file meta-info in both sides and left a block of comment on `filemanager`'s file reading mentioning the snapshot-state problem (not solved now though).

r? @Manishearth

<!-- Please describe your changes on the following line: -->

---
<!-- 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

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 665559556f5aeac5820e17684b14311aa3767c0c
2016-07-12 22:00:08 -07:00
Zhen Zhang 1e745db4f5 servo: Merge #12378 - Add FileID validity setting/checking logic to Blob URL implementation (from izgzhen:blob-url-revocation-fix); r=Manishearth
r? @Manishearth

---
<!-- 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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 42e90f7db9d5ee7c6176e35e600cd27fe9c6748c
2016-07-11 00:13:45 -07:00
Zhen Zhang 01fe9016e4 servo: Merge #12344 - Add ability to WPT-test file uploads and fetches, fixes #12322 (from izgzhen:set-file-js); r=Manishearth
Using `inputElem.selectFiles(["path1", "path2"])` in JavaScript with pref `dom.htmlinputelement.select_files.enabled` = `true` will simulate the effect of `inputElem.click()`.

See #12322  for more, also related to #12343.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8cb05a36bc1a20ec6373ddb23ce127c7801ba5d6
2016-07-09 02:02:34 -07:00
Zhen Zhang eb3875e623 servo: Merge #12268 - Spawn threads for requests in file manager (from izgzhen:fm-spawn); r=Manishearth
r? @Manishearth

---
<!-- 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

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: c2a22bd05e0c8282175422df26e188ef63bcc452
2016-07-08 20:33:26 -07:00
Zhen Zhang da9b7c774e servo: Merge #12258 - Remove DataSlice, fix #12249 (from izgzhen:remove-data-slice); r=Manishearth
r? @Manishearth

---
<!-- 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 #12249

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 87c77725279ba3f1b612e27fccf353c81eae17b8
2016-07-05 06:24:46 -07:00
Zhen Zhang 182611cd28 servo: Merge #11875 - Integration and improvements of File API backends (from izgzhen:file-manager-backend); r=Manishearth
Basically three major changes:

1. More complete origin check in `FileManagerThreadMsg`
2. Add reference counting logic to file manage store and script API
3. Integrate the support of slicing

r? @Manishearth

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 36974f0746261b971c93ed7dfb9bd726675ccf69
2016-07-04 09:15:23 -07:00
Zhen Zhang 3979b057f1 servo: Merge #11757 - Implement filter for file-type input's accept attribute (from izgzhen:file-acccept-mime-filter); r=Manishearth
Now the two sides are pasted together with the new version of `mime_guess` landed.

I tested this thing locally with stuff like this:

```html
<input id="input_file" type="file" accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"></input>
<a onclick="open_file();">Click</a>

<script type="text/javascript">
    function open_file() {
        console.log("Open file");
        document.getElementById("input_file").click();
    }
</script>
```

Will WPT be able to handle this automatically?

---
<!-- 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 is related to #11131

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 33bda9c207001b1f4f0676cbab3222218e94e987
2016-06-20 12:06:52 -05:00
Zhen Zhang d9f7b258af servo: Merge #11716 - Implement Blob URL's DOM interfaces (from izgzhen:impl-blob-url-dom); r=Manishearth
r? @Manishearth

Implement the two functions in `URL` to create/revoke Blob URLs, and related code to approximate our proposed design to make things work together.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 part of #10539, related to #11131

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 0c9d0eb68575f20a8239bac8204f8e25de0f61d2
2016-06-17 07:26:16 -05:00
Zhen Zhang 15a33f61c0 servo: Merge #11717 - Add filepicker (from izgzhen:filepicker); r=Manishearth
Add filepicker

Add file picker based on tinyfiledialog to the file manager implementation.

Changes:
- [x] Add the picker invocation code
- [x] Rewrite unit test to accommodate the change
- [x] Patch up `htmlinputelement` to make things work

<!-- Please describe your changes on the following line: -->

---
<!-- 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 are related to #11131.

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 0cfae3a3e756c5719b5ab58dde9d0eacc7f197be
2016-06-14 07:27:47 -05:00
Zhen Zhang b8ff31f979 servo: Merge #11552 - Improve implementation and add testing regarding file manager thread (from izgzhen:add-testing-fix-filemanager); r=Manishearth
First there is a more completed unit test. And in the test running, I found a runtime error `Serde(Custom("bincode does not support Deserializer::deserialize))` when reading response from file manage thread. I analyzed a bit and found that it is probably caused by the `Uuid` field. I temporarily work around it by making the `Id` essentially a string wrapped inside `SelectedFileId`.

Related to PR #11131.

<!-- Please describe your changes on the following line: -->

---
<!-- 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

<!-- Either: -->
- [x] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 6f9016cf3edce828bf0edb5411b963d7c9f2d209
2016-06-09 18:14:30 -05:00
Zhen Zhang 319a151aff servo: Merge #11536 - Add blob loader (from izgzhen:add-blob-loader); r=Manishearth
Add a blob loader to implement [Blob URL](https://w3c.github.io/FileAPI/#url). The related interfaces to script thread are also declared.

Progressing in parallel with PR #11534. Related to #11131.

<!-- Please describe your changes on the following line: -->

---
<!-- 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 part of #10539

<!-- Either: -->
- [x] These changes do not require tests because not integrated yet.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 3977128d7e8a21425650894c6ecd55b71bcfa042
2016-06-08 06:13:39 -05:00
Zhen Zhang 615bc1161a servo: Merge #11368 - Fix FileManager thread panic and other misc improvements (from izgzhen:fix-filemanager-exit); r=asajeffrey
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy --faster` does not report any errors
- [x] There are tests for these changes

Changes:

- Add shut down logic for FileManager thread
- Add an unit test for filemanager_thread

Source-Repo: https://github.com/servo/servo
Source-Revision: 0b64586bf5368f6bb200353205459c7ec88f7052
2016-05-24 22:17:15 -05:00
Zhen Zhang d77fd07ddc servo: Merge #11225 - Implement file related functionalities in htmlinputelement and related (from izgzhen:patch-input-element-file); r=Manishearth
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy --faster` does not report any errors
- [x] These changes is related to #11131
- [x] These changes do not require tests because it is a partial implementation

1. Improve the `filemanager_thread` by adding type string and create `SelectedFile`
2. Fill several gaps in `htmlinputelement` implementation related to file type
3. Improve the `File` interface to accommodate the above changes
4. Integrate changes introduced by PR #11189

Source-Repo: https://github.com/servo/servo
Source-Revision: 7cea4eb01ce3b84ca276ca417d933fb122005b51
2016-05-23 01:10:46 -07:00
Zhen Zhang 8dcba1aa4d servo: Merge #11029 - Add FileManagerThread (from izgzhen:filemanager_thread); r=Manishearth
This is intended to support the File API implementation. Basically an event loop with three kinds of messages:

+ Select a file
+ Read a file with ID
+ Delete the ID from manager-owned map

The design decision in this PR is not the final (or best I think) version, welcome reviews :)

TODOs:

- [x] Add multiple file selection

Source-Repo: https://github.com/servo/servo
Source-Revision: b61ad4190f7fb7d4fa32e01a0e3db77a912cb7cf
2016-05-11 04:28:58 -07:00