gecko-dev/servo/components/net
Patrick Walton 3b92de7a22 servo: Merge #6586 - script: Make the resource task communication use IPC channels (from pcwalton:resource-task-ipc); r=jdm
This change makes Servo use serialized messages over IPC channels for resource loading. The goal is to make it easier to make Servo multiprocess in the future. This patch does not make Servo multiprocess now; there are many other channels that need to be changed to IPC before that can happen. It does introduce a dependency on https://github.com/serde-rs/serde and https://github.com/pcwalton/ipc-channel for the first time.

At the moment, `ipc-channel` uses JSON for serialization. This is because serde does not yet have official support for bincode. When serde gains support for bincode, I'll switch to that. For now, however, the JSON encoding and decoding will constitute a significant performance regression in resource loading.

To avoid having to send boxed `AsyncResponseTarget` trait objects across process boundaries, this series of commits changes `AsyncResponseTarget` to wrap a sender only. It is then the client's responsibility to spawn a thread to proxy calls from that sender to the consumer of the resource data. This only had to be done in a few places. In the future, we may want to collapse those threads into one per process to reduce overhead. (It is impossible to continue to use `AsyncResponseTarget` as a boxed trait object across processes, regardless of how much work is done on `ipc-channel`. Vtables are fundamentally incompatible with IPC across mutually untrusting processes.)

In general, I was pretty pleased with how this turned out. The main changes are adding serialization functionality to various objects that `serde` does not know how to serialize natively—the most complicated being Hyper objects—and reworking `AsyncResponseTarget`. The overall structure of the code is unchanged, and other than `AsyncResponseTarget` no functionality was lost in moving to serialization and IPC.

r? @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 2eb122f394651232abd683fc576a5c4288bf277f
2015-07-31 16:06:36 -06:00
..
fetch servo: Merge #6591 - Upgrade to rustc 1.3.0-dev (fddfd089b 2015-07-10) (from servo:rustup_2015-07-10); r=larsbergstrom 2015-07-14 13:40:22 -06:00
about_loader.rs servo: Merge #6586 - script: Make the resource task communication use IPC channels (from pcwalton:resource-task-ipc); r=jdm 2015-07-31 16:06:36 -06:00
Cargo.toml servo: Merge #6586 - script: Make the resource task communication use IPC channels (from pcwalton:resource-task-ipc); r=jdm 2015-07-31 16:06:36 -06:00
cookie_storage.rs servo: Merge #6174 - Reduce max line length from 150 to 120 characters (from frewsxcv:cleanup-long-lines); r=SimonSapin 2015-05-24 18:27:26 -05:00
cookie.rs servo: Merge #6325 - Use str::parse() rather than FromStr::from_str (from Ms2ger:from_str); r=nox 2015-06-14 03:55:56 -06:00
data_loader.rs servo: Merge #6586 - script: Make the resource task communication use IPC channels (from pcwalton:resource-task-ipc); r=jdm 2015-07-31 16:06:36 -06:00
file_loader.rs servo: Merge #5935 - Upgrade Rust (from servo:rustup_2015-04-25); r=Ms2ger 2015-05-05 09:11:30 -05:00
hsts.rs servo: Merge #6490 - Implement HSTS (preload-only) (from samfoo:hsts-preload); r=jdm 2015-07-22 10:23:05 -06:00
http_loader.rs servo: Merge #6586 - script: Make the resource task communication use IPC channels (from pcwalton:resource-task-ipc); r=jdm 2015-07-31 16:06:36 -06:00
image_cache_task.rs servo: Merge #6586 - script: Make the resource task communication use IPC channels (from pcwalton:resource-task-ipc); r=jdm 2015-07-31 16:06:36 -06:00
lib.rs servo: Merge #6746 - net: Convert the storage task to use IPC (from pcwalton:storage-task-ipc); r=jdm 2015-07-26 18:07:32 -06:00
mime_classifier.rs servo: Merge #6450 - Remove is_some() from mime_classifier.rs (from pyfisch:patch-1); r=metajack 2015-06-23 15:14:30 -06:00
net_error_list.rs servo: Merge #6175 - Embedding: revenge of cargo (from zmike:embedding-REVENGE_OF_CARGO); r=larsbergstrom 2015-05-27 14:17:32 -05:00
pub_domains.rs servo: Merge #4519 - Cookie support (from jdm:cookies); r=Ms2ger 2015-02-04 11:57:54 -07:00
resource_task.rs servo: Merge #6586 - script: Make the resource task communication use IPC channels (from pcwalton:resource-task-ipc); r=jdm 2015-07-31 16:06:36 -06:00
storage_task.rs servo: Merge #6746 - net: Convert the storage task to use IPC (from pcwalton:storage-task-ipc); r=jdm 2015-07-26 18:07:32 -06:00