Commit graph

1007 commits

Author SHA1 Message Date
Ms2ger
479cf1ef23 Stop panicking when trying to load ftp URLs. 2016-11-02 16:15:26 +01:00
Ms2ger
634a3989ad Move ResponseAction to the image cache. 2016-11-02 16:15:25 +01:00
Ms2ger
fe3d512ea4 Remove ProgressSender::Listener. 2016-11-02 16:15:23 +01:00
Ms2ger
8a6016013e Remove unused argument to start_sending_opt. 2016-11-02 16:15:22 +01:00
Ms2ger
40c711bf97 Remove LoadConsumer::Listener. 2016-11-02 16:15:21 +01:00
Ms2ger
e8d9546035 Use fetch_async in the image cache. 2016-11-02 16:15:20 +01:00
Ms2ger
b9ad395a61 Set cookies in http_network_fetch. 2016-11-02 09:25:55 +01:00
Ms2ger
2d430050a8 Only pass the headers to set_cookies_from_response.
I will need to call it from the fetch code, which does not have a
HttpResponse on hand.

Also, rename the function to match its new signature.
2016-11-02 09:20:32 +01:00
Ms2ger
f34534740a Pass the entire FetchContext to http_network_fetch. 2016-11-02 09:20:31 +01:00
Ms2ger
28d06ab40a Store the referrer in the Response and return it in Response::metadata(). 2016-11-02 09:20:30 +01:00
Ms2ger
a66f186866 Return a network error Response from http_network_fetch when obtain_response fails. 2016-11-02 09:20:29 +01:00
Ms2ger
784c45a306 Store the NetworkError in network error Responses. 2016-11-02 09:20:28 +01:00
Ms2ger
6af63d6af1 Make the status handling in http_fetch more robust. 2016-11-02 09:20:27 +01:00
bors-servo
291f393723 Auto merge of #13986 - iamrohit7:tidy-feature-attrs, r=Wafflespeanut
Make test-tidy check for alphabetical ordering of #![feature(...)] statements

<!-- 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 #13954  (github issue number if applicable).

<!-- Either: -->
- [X] 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. -->

<!-- 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/13986)

<!-- Reviewable:end -->
2016-11-01 01:13:35 -05:00
Rohit Burra
32ba45ab6f Fix tidy issues 2016-11-01 11:35:40 +05:30
Daan Sprenkels
66059904b7 Remove extra spaces in function calls and declarations 2016-10-31 18:11:37 +01:00
Ms2ger
6bd5d2716b Avoid some unnecessary clones when handling cookies. 2016-10-20 09:38:47 +02:00
Glenn Watson
acfdfd2fa9 Remove old rendering backend.
This removes paint threads, rust-layers dependency, and changes
optional webrender types to be required.

The use_webrender option has been removed, however I've left
the "-w" command line option in place so that wpt
runner can continue to pass that. Once it's removed from there
we can also remove the -w option.

Once this stage is complete, it should be fine to change the
display list building code to generate webrender display
lists directly and avoid the conversion step.
2016-10-18 10:21:27 +10:00
Ms2ger
e134871a95 Implement blob url support in the fetch stack. 2016-10-14 14:18:03 +02:00
Ms2ger
92f1cbcbe3 Stop spawning threads unnecessarily in FileManager.
The spawned threads remain for select_file and select_files, as those may
need to wait indefinitely for the user's response.
2016-10-14 14:12:24 +02:00
Ms2ger
c513b5f226 Avoid an unnecessary clone when calling FileManagerStore::try_read_file. 2016-10-14 11:30:10 +02:00
Ms2ger
fc68e0a6ca Add a FileManager to FetchContext. 2016-10-14 11:30:09 +02:00
Ms2ger
d820387758 Stop wrapping FileManager in an Arc.
It already contains an Arc internally.
2016-10-14 11:30:08 +02:00
Corey Farwell
60afad1b61 Migrate user agent string to Cow<'static, str>.
In most scenarios, where the user of Servo will not override the default
user agent, the user agent can be a `&'static str`. But since we allow
for customization, we currently use a `String` to represent the user
agent. This commit migrates the user agent to be represented as a
`Cow<'static, str>`, which (at the cost of ergonomics) prevents
unnecessary allocations whenever cloning the user agent string in the
scenario the user doesn't override the user agent.
2016-10-10 16:34:20 -04:00
Anthony Ramine
1854566683 Update to Rust 1.14.0-nightly (19ac57926 2016-10-08)
A cargo bump and a switch to serde_derive is needed to do this rustup.
2016-10-09 18:53:47 +02:00
bors-servo
b1d8eff467 Auto merge of #13411 - frewsxcv:mime, r=jdm
Migrate mime_classifier top-level string to enum.

I made this branch months ago and forgot about it. Instead of just throwing the changes away, I rebased off origin/master and opened this pull request. If these changes aren't desired, no feelings hurt, just close this. If they are desired, let me know if there are any changes you want me to make and I'll also need to rewrite/squash the commits.

<!-- 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/13411)
<!-- Reviewable:end -->
2016-10-08 15:40:47 -05:00
Corey Farwell
349e01f6eb Fix capitalization for enum variants. 2016-10-08 15:48:18 -04:00
Corey Farwell
66303e40b5 Migrate mime_classifier top-level string to enum. 2016-10-08 15:41:58 -04:00
Jan Zerebecki
95a7482d26 Remove same-origin-data-url flag from fetch implementation
The spec removed it. Check the scheme instead, data is always same origin now,
except for workers.
This also updates the comments to make step numbers match the spec.
Closes #13362
2016-10-01 00:27:03 -07:00
Alan Jeffrey
a74fe58563 Moved pub_domains to net_traits and did a spring clean. 2016-09-29 17:28:47 -05:00
Ms2ger
ccfd977076 Avoid a possible deadlock in main_fetch's synchronous code.
On playpen, similar code caused a deadlock on 1.11 stable, and worked fine
on nightly 1.13; it seems safer to avoid the pattern entirely.
2016-09-23 09:36:02 +02:00
Keith Yeung
6fbd2aa5b7 Avoid deadlock in main_fetch 2016-09-21 14:26:09 -07:00
Keith Yeung
07c9cfecec Add FetchMetadata and update corresponding methods 2016-09-21 14:26:03 -07:00
Corey Farwell
3aa2ec653a Don't require PathBuf ownership if we don't need it. 2016-09-16 23:11:04 -04:00
bors-servo
8ccfffaa77 Auto merge of #13294 - 6112:referrer-typo-fix, r=jdm
Fix most typoes for: "referer" -> "referrer"

Replace most uses of the word "referer" with "referrer", except for `hyper::header::Referer`. Also update the unit tests to compile & pass after those changes.

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

<!-- Either: -->
- [ ]  There are tests for these changes OR
- [X] These changes do not require tests because they're only typo fixes.

<!-- 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/13294)
<!-- Reviewable:end -->
2016-09-16 15:43:54 -05:00
Nicolas
924136ee0c Fix most typoes for: "referer" -> "referrer" 2016-09-16 12:40:17 -04:00
Bryan Gilbert
0bcd04d2ab store basic auth in cache on redirect response 2016-09-15 22:08:52 -04:00
Bryan Gilbert
82e45a403f updated basic auth cache to key off of url origin 2016-09-15 22:08:52 -04:00
zakorgyula
f4fda68409 Annotations for requestDevice, request_bluetooth_devices and matches_filter functions 2016-09-14 08:41:03 +02:00
zakorgyula
359548f607 requestDevice update 2016-09-14 08:41:02 +02:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
bors-servo
5a5a76cc5d Auto merge of #13058 - malisas:malisa-responseAPI, r=Manishearth,jdm
Response API

<!-- Please describe your changes on the following line: -->
This PR adds the [dom::Response](https://fetch.spec.whatwg.org/#response-class) implementation and addresses #11896.

The relevant passing tests` expectations have been updated.

In order to allow non-UTF-8-encoded status messages, `net_traits::response::Response`'s `raw_status` field has been changed from type [`Option<RawStatus>`](https://doc.servo.org/hyper/http/struct.RawStatus.html) to type `Option<(u16, Vec<u8>)>`. As a result, a few other files which rely on the `raw_status` field were affected and updated.

TODOs:
- The `body` and `trailer` methods. Relies on implementation of `ReadableStream` and `Promise`s.
- Similarly, replace the dummy constructor `_body: Option<USVString>` argument with `body: ResponseBodyInit`.
- Currently, whenever `r's response's header list` or `r's Headers object` are mentioned, I always modify the `headers_reflector` field (of type dom::Headers, or `r's Headers object`) and not the corresponding hyper::Headers list in the net_traits::Response field. A completely accurate interpretation of the spec might consider making both of these lists the same thing via a reference. [Discussion](https://github.com/whatwg/fetch/issues/358) was [had](https://github.com/servo/servo/pull/12884).

---
<!-- 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: -->
- [X] 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. -->

<!-- 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/13058)
<!-- Reviewable:end -->
2016-09-08 18:58:05 -05:00
Malisa Smith
faf32a7cfb dom::Response implementation 2016-09-06 19:58:32 -07:00
Attila Dusnoki
ccc66d0c32 WebBluetooth Android support 2016-09-06 12:48:04 +02:00
bors-servo
f66382f75c Auto merge of #13071 - wdv4758h:cors_preflight_fetch, r=jdm
Solved wrong referrer policy in cors_preflight_fetch

Solved wrong referrer policy in cors_preflight_fetch

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

<!-- 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/13071)
<!-- Reviewable:end -->
2016-08-27 05:20:46 -05:00
Chiu-Hsiang Hsu
3c93ced76a Solved wrong referrer policy in cors_preflight_fetch 2016-08-27 16:02:23 +08:00
bors-servo
b399fcb54b Auto merge of #13069 - hsinewu:#13025, r=jdm
pass request value instead of constant

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

<!-- Either: -->
- [X] These changes do not require tests because stated in the issue

<!-- 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/13069)
<!-- Reviewable:end -->
2016-08-26 23:07:34 -05:00
hsinewu
1db1a7671e pass request value instead of constant 2016-08-27 12:03:49 +08:00
Zhen Zhang
2527dc07f2 Burn SelectedFileId in fire 2016-08-22 10:05:01 +02:00
Anthony Ramine
03a0170c91 Update to webrender 0.4.0 2016-08-18 19:33:12 +02:00