Commit graph

1020 commits

Author SHA1 Message Date
Anthony Ramine
d022535f9c Make the WebSocket handshake ourselves to ease switching libs
We need to switch to tungstenite to finally update openssl, this commit
rewrites the whole websocket infrastructure to properly follow the Fetch
spec and to make switching to a different websocket library easier.
2017-03-29 19:17:27 +02:00
Anthony Ramine
3ed32f8078 Introduce NetworkError::from_hyper_error and from_ssl_error 2017-03-29 18:01:01 +02:00
bors-servo
299f9446e6 Auto merge of #16160 - nox:tungstenite, r=jdm
Some enhancements in the net crate

See the individual 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/16160)
<!-- Reviewable:end -->
2017-03-29 03:33:53 -05:00
Anthony Ramine
02b2aa159a Store SSL context in ResourceGroup
This allows sharing it with the HTTP state in CoreResourceManager::fetch.
2017-03-28 00:52:10 +02:00
Anthony Ramine
7a4632bfa2 Introduce create_ssl_context 2017-03-28 00:37:25 +02:00
Fernando Jiménez Moreno
fa433a74b1 Remove useless ImageDecoderRunnable struct 2017-03-27 20:44:04 +02:00
Fernando Jiménez Moreno
f4da16566d Make ImageCacheImpl have a single Mutex<ImageCacheStore> and use ImageDecoderRunnable 2017-03-27 19:54:15 +02:00
Fernando Jiménez Moreno
166c4e8bb2 Move image cache implementation to the net crate 2017-03-27 19:54:15 +02:00
Fernando Jiménez Moreno
72d7ee613b Make image cache per-document rather than global 2017-03-27 19:54:13 +02:00
Fernando Jiménez Moreno
d919f55884 Update http_network_or_cache_fetch according to spec 2017-03-27 19:45:05 +02:00
Anthony Ramine
e2e2d42e38 Introduce http_loader::is_redirect_status 2017-03-27 14:51:10 +02:00
Anthony Ramine
d64aa9c5bf Simplify should_be_blocked_due_to_nosniff 2017-03-27 14:14:34 +02:00
bors-servo
d992442dc6 Auto merge of #16137 - nox:die-rustc-serialize-die, r=emilio
Replace use of rustc_serialize::base64 by base64

<!-- 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/16137)
<!-- Reviewable:end -->
2017-03-26 12:23:17 -07:00
Anthony Ramine
8796a82b9f Put websocket_loader::init first in its module 2017-03-26 16:15:12 +02:00
Anthony Ramine
b096bf4806 Use Url::port instead of Url::port_or_known_default to set Host
AFAIK, if there is no explicit port in the request URL, there should be
no explicit port in the Host header.
2017-03-26 16:15:10 +02:00
Anthony Ramine
92c4a43946 Use NetworkConnector directly to account for replaced hosts
This let us remove a hack where we had to replace the host in the request URL.
2017-03-26 16:15:09 +02:00
Anthony Ramine
54d37d920c Remove some useless Option<T> wrappers from ServoUrl methods 2017-03-26 16:15:06 +02:00
Anthony Ramine
bc5c4fa892 Rework replace_hosts and host_replacement
They do less cloning now.
2017-03-26 16:14:22 +02:00
Anthony Ramine
0ed4df28b5 Replace use of rustc_serialize::base64 by base64 2017-03-26 14:15:31 +02:00
Anthony Ramine
28e4252a05 Remove some useless thread spawning in websocket_loader 2017-03-24 12:46:38 +01:00
Anthony Ramine
a6d22b1a35 Only pass the protocol in use in to establish a WS connection 2017-03-24 11:09:30 +01:00
Anthony Ramine
0bd54b904b Properly follow the spec in WebSocket::Constructor 2017-03-24 09:43:14 +01:00
Anthony Ramine
bba0be13dd Make ServoUrl::as_url return a &Url 2017-03-23 15:37:32 +01:00
Anthony Ramine
fb2c9e7bf5 Introduce fetch::methods::should_be_blocked_due_to_bad_port 2017-03-23 14:48:23 +01:00
Alan Jeffrey
f05577cb29 Disabled tinyfiledialogs when running headless. 2017-03-16 08:48:33 -05:00
Fernando Jiménez Moreno
469eb192c5 Allow for redirects after a CORS-preflight 2017-03-10 16:39:33 +01:00
bors-servo
b97b0fd7cc Auto merge of #15899 - glennw:wr-update-premultiply, r=nox
Update WR (pre-multiplied alpha)

<!-- 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/15899)
<!-- Reviewable:end -->
2017-03-10 02:27:23 -08:00
bors-servo
a11a3fe68b Auto merge of #15903 - servo:set-origin-header, r=Wafflespeanut
Set Origin header in http_network_or_cache_fetch

<!-- 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/15903)
<!-- Reviewable:end -->
2017-03-09 22:15:11 -08:00
rabisg
de2b9b7707 Fixes #14787: Set Origin header in http_network_or_cache_fetch
Sets Origin header on request with CORS flag set or on requests other
than those with GET/HEAD methods
2017-03-10 11:44:21 +05:30
Jamie Nicol
ec3142e811 Premultiply RGBA image data before sending to webrender 2017-03-10 11:06:44 +10:00
bors-servo
5fe921f2ab Auto merge of #15844 - notriddle:domain_match_lowercase, r=nox
Assert that `domain_match` is operating on lowercase text

> (Note that both the domain string and the string will have been
> canonicalized to lower case at this point.)

Related to #15789

<!-- 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/15844)
<!-- Reviewable:end -->
2017-03-08 18:18:16 -08:00
Michael Howell
b0499e3422 Assert that domain_match is operating on lowercase text
> (Note that both the domain string and the string will have been
> canonicalized to lower case at this point.)

Related to #15789
2017-03-09 02:18:02 +00:00
Ms2ger
5a61d8b2ea Remove unused content blocker code.
I don't know what it is for, so I believe it would be better to remove it
entirely until and unless we start using it.
2017-03-07 10:29:27 +01:00
Sumant Manne
8aac575019 Implemented nosniff for fetch algorithm 2017-03-03 15:50:58 +01:00
Anthony Ramine
da45177d52 Switch to our own websocket fork 2017-03-02 16:40:02 +01:00
Anthony Ramine
f8467a26c4 Kill serde_codegen 💣 2017-02-28 19:31:25 +01:00
Glenn Watson
64a9a45b2a Update WR (image tiling, inset box shadow fixes, new key api). 2017-02-27 08:54:28 +10:00
Anthony Ramine
2efa5092da Remove rustc-serialize from url 2017-02-24 02:48:42 +01:00
Anthony Ramine
3ad540853c Remove rustc-serialize from cookie 2017-02-24 02:39:57 +01:00
bors-servo
a780f6f28c Auto merge of #15696 - jdm:no-http-pool, r=emilio
Do not pool HTTP connections.

HTTP connection pooling triggers consistent failures in #14620. Let's disable it until there's more time to solve the underlying problem in #15694.

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

<!-- 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/15696)
<!-- Reviewable:end -->
2017-02-23 03:55:45 -08:00
Josh Matthews
3258cffcda Do not pool HTTP connections. 2017-02-22 17:16:28 -05:00
Josh Matthews
b174a684d1 Add useful debug information to image cache. 2017-02-22 14:19:35 -05:00
Josh Matthews
0d2ec852ac Send response for image requests progressively to image cache. 2017-02-22 14:19:35 -05:00
Josh Matthews
21118f0a8a Synchronously decode images if decoded bytes are requested after the full response is received. 2017-02-22 14:19:35 -05:00
Josh Matthews
980eb5ac33 Avoid dropping image requests on the ground from non-script-initiated reflow. 2017-02-22 14:19:35 -05:00
Josh Matthews
c890c9143c Make script thread initiate requests for images needed by layout.
In support of this goal, the layout thread collects information about
CSS images that are missing image data and hands it off to the script
thread after layout completes. The script thread stores a list of
nodes that will need to be reflowed after the associated network
request is complete. The script thread ensures that the nodes are
not GCed while a request is ongoing, which the layout thread is
incapable of guaranteeing.

The image cache's API has also been redesigned in support of this
work. No network requests are made by the new image cache, since it
does not possess the document-specific information necessary to
initiate them. Instead, there is now a single, synchronous
query operation that optionally reserves a slot when a cache
entry for a URL cannot be found. This reserved slot is then
the responsibility of the queryer to populate with the contents
of the network response for the URL once it is complete. Any
subsequent queries for the same URL will be informed that the
response is pending until that occurs.

The changes to layout also remove the synchronous image loading
code path, which means that reftests now test the same code
that non-test binaries execute. The decision to take a screenshot
now considers whether there are any outstanding image
requests for layout in order to avoid intermittent failures in
reftests that use CSS images.
2017-02-22 14:19:35 -05:00
Connor Brewster
bfd7b950ad Add ImmutableOrigin to allow for serializing origins 2017-02-22 11:11:59 -06:00
Anthony Ramine
fd9cd33892 Use serde_json to persist cookies in the net crate 2017-02-22 12:33:10 +01:00
Anthony Ramine
63c4490e73 Kill the plugins crate and its clippy support
Sometimes clippy gets outdated by months, and its current support setup
means that each Servo component need to opt into it by depending on
the plugins crate manually, and not all components do that.
2017-02-21 11:50:36 +01:00
Anthony Ramine
fe3f4ff0c2 Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00