servo/components/script/dom
bors-servo 2eb122f394 Auto merge of #6586 - pcwalton:resource-task-ipc, r=jdm
script: Make the resource task communication use IPC channels.

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

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6586)
<!-- Reviewable:end -->
2015-07-31 16:06:36 -06:00
..
bindings script: Fix test failures. 2015-07-31 15:03:39 -07:00
webidls Implement getComputedStyle 2015-07-29 20:17:50 -04:00
activation.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
attr.rs Create and utilize utility for joining strs 2015-07-08 05:18:07 +09:00
blob.rs Refactor FileReader #6762 #6763 #6750 #6751 2015-07-29 14:18:59 +02:00
browsercontext.rs Make struct part of unrooted_must_root handle type parameters 2015-07-22 00:01:26 +05:30
canvasgradient.rs Refactor #[jstraceable] to #[derive(JSTraceable)] 2015-07-01 18:27:06 -04:00
canvaspattern.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
canvasrenderingcontext2d.rs script: Make the ImageCacheTask use IPC. 2015-07-26 23:07:44 -07:00
characterdata.rs Use local slice_chars 2015-07-31 12:23:13 -06:00
closeevent.rs Add spec links 2015-07-28 13:28:41 +02:00
comment.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
console.rs Add spec links 2015-07-28 13:28:41 +02:00
create.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
crypto.rs Add spec links 2015-07-28 13:28:41 +02:00
css.rs Implement the CSS interface 2015-04-25 12:36:38 +02:00
cssstyledeclaration.rs Return None as style for elements not in a document 2015-07-30 12:36:08 -04:00
customevent.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
dedicatedworkerglobalscope.rs script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
document.rs script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
documentfragment.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
documenttype.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
domexception.rs Implement window.crypto.getRandomValues() 2015-07-03 18:34:00 +02:00
domimplementation.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
domparser.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
dompoint.rs Add spec links 2015-07-28 13:28:41 +02:00
dompointreadonly.rs Add spec links 2015-07-28 13:28:41 +02:00
domrect.rs Add spec links 2015-07-28 13:28:41 +02:00
domrectlist.rs Add spec links 2015-07-28 13:28:41 +02:00
domstringmap.rs Add spec links 2015-07-28 13:28:41 +02:00
domtokenlist.rs Add spec links 2015-07-28 13:28:41 +02:00
element.rs Auto merge of #5851 - evilpie:background, r=SimonSapin 2015-07-29 14:37:45 -06:00
errorevent.rs Add spec links 2015-07-28 13:28:41 +02:00
event.rs Remove some more unnecessary let bindings 2015-07-14 14:48:16 -04:00
eventdispatcher.rs Introduce RootedVec<JS<T>>::r() 2015-07-23 20:56:27 +02:00
eventtarget.rs Add spec links 2015-07-28 13:28:41 +02:00
file.rs Add spec links 2015-07-28 13:28:41 +02:00
filereader.rs Refactor FileReader #6762 #6763 #6750 #6751 2015-07-29 14:18:59 +02:00
formdata.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlanchorelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlappletelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlareaelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlaudioelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlbaseelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlbodyelement.rs Auto merge of #5851 - evilpie:background, r=SimonSapin 2015-07-29 14:37:45 -06:00
htmlbrelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlbuttonelement.rs Auto merge of #6850 - servo:rustup_2015-07-30, r=SimonSapin 2015-07-30 14:46:13 -06:00
htmlcanvaselement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlcollection.rs Add spec links 2015-07-28 13:28:41 +02:00
htmldataelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmldatalistelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmldialogelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmldirectoryelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmldivelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmldlistelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlelement.rs Implement getComputedStyle 2015-07-29 20:17:50 -04:00
htmlembedelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlfieldsetelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlfontelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlformelement.rs Remove usage of the deprecated OwnedAsciiExt 2015-07-30 18:01:41 +02:00
htmlframeelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlframesetelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlheadelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlheadingelement.rs Refactor #[jstraceable] to #[derive(JSTraceable)] 2015-07-01 18:27:06 -04:00
htmlhrelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlhtmlelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmliframeelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlimageelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlinputelement.rs Auto merge of #6850 - servo:rustup_2015-07-30, r=SimonSapin 2015-07-30 14:46:13 -06:00
htmllabelelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmllegendelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmllielement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmllinkelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlmapelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlmediaelement.rs Refactor #[jstraceable] to #[derive(JSTraceable)] 2015-07-01 18:27:06 -04:00
htmlmetaelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlmeterelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlmodelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlobjectelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlolistelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmloptgroupelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmloptionelement.rs Fix deprecation warnings 2015-07-24 22:16:35 +02:00
htmloutputelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlparagraphelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlparamelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlpreelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlprogresselement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlquoteelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlscriptelement.rs script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
htmlselectelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmlsourceelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlspanelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlstyleelement.rs Introduce VirtualMethods::children_changed() 2015-07-25 19:09:40 +02:00
htmltablecaptionelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltablecellelement.rs Refactor #[jstraceable] to #[derive(JSTraceable)] 2015-07-01 18:27:06 -04:00
htmltablecolelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltabledatacellelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltableelement.rs Add spec links 2015-07-28 13:28:41 +02:00
htmltableheadercellelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltablerowelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltablesectionelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltemplateelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltextareaelement.rs Introduce VirtualMethods::children_changed() 2015-07-25 19:09:40 +02:00
htmltimeelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmltitleelement.rs Introduce VirtualMethods::children_changed() 2015-07-25 19:09:40 +02:00
htmltrackelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlulistelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlunknownelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
htmlvideoelement.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
imagedata.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
keyboardevent.rs Add spec links 2015-07-28 13:28:41 +02:00
location.rs Implement URL and trivially missing URLUtils members 2015-06-20 15:17:55 +02:00
macros.rs Remove usage of the deprecated OwnedAsciiExt 2015-07-30 18:01:41 +02:00
messageevent.rs Add spec links 2015-07-28 13:28:41 +02:00
mod.rs Implement FileReader.{readAsText,readAsDataUrl}. Fixes #6172 2015-07-23 22:33:51 +02:00
mouseevent.rs Refactor FileReader #6762 #6763 #6750 #6751 2015-07-29 14:18:59 +02:00
namednodemap.rs Add spec links 2015-07-28 13:28:41 +02:00
navigator.rs Add spec links 2015-07-28 13:28:41 +02:00
navigatorinfo.rs Implement Navigator.appVersion(#5409) 2015-04-01 00:36:40 +09:00
node.rs Auto merge of #6800 - frewsxcv:childnode-before-childnode-after, r=Ms2ger 2015-07-30 04:13:39 -06:00
nodeiterator.rs Refactor #[jstraceable] to #[derive(JSTraceable)] 2015-07-01 18:27:06 -04:00
nodelist.rs Add spec links 2015-07-28 13:28:41 +02:00
performance.rs Add spec links 2015-07-28 13:28:41 +02:00
performancetiming.rs Add spec links 2015-07-28 13:28:41 +02:00
processinginstruction.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
progressevent.rs Add spec links 2015-07-28 13:28:41 +02:00
range.rs Implement Range#extractContents 2015-07-28 12:52:29 -04:00
screen.rs Add spec links 2015-07-28 13:28:41 +02:00
servohtmlparser.rs script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
storage.rs Add spec links 2015-07-28 13:28:41 +02:00
storageevent.rs Add spec links 2015-07-28 13:28:41 +02:00
testbinding.rs Add spec links 2015-07-28 13:28:41 +02:00
testbindingproxy.rs Add spec links 2015-07-28 13:28:41 +02:00
text.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
textdecoder.rs Add spec links 2015-07-28 13:28:41 +02:00
textencoder.rs Add spec links 2015-07-28 13:28:41 +02:00
treewalker.rs Refactor #[jstraceable] to #[derive(JSTraceable)] 2015-07-01 18:27:06 -04:00
uievent.rs Add spec links 2015-07-28 13:28:41 +02:00
url.rs Implement URL and trivially missing URLUtils members 2015-06-20 15:17:55 +02:00
urlhelper.rs Implement URL and trivially missing URLUtils members 2015-06-20 15:17:55 +02:00
urlsearchparams.rs Remove some more unnecessary let bindings 2015-07-14 14:48:16 -04:00
userscripts.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
validitystate.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
virtualmethods.rs Introduce VirtualMethods::children_changed() 2015-07-25 19:09:40 +02:00
webglactiveinfo.rs Add spec links 2015-07-28 13:28:41 +02:00
webglbuffer.rs script: Make most of 2D canvas and WebGL run over IPC. 2015-07-25 00:50:12 -07:00
webglframebuffer.rs script: Make most of 2D canvas and WebGL run over IPC. 2015-07-25 00:50:12 -07:00
webglobject.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00
webglprogram.rs script: Make most of 2D canvas and WebGL run over IPC. 2015-07-25 00:50:12 -07:00
webglrenderbuffer.rs script: Make most of 2D canvas and WebGL run over IPC. 2015-07-25 00:50:12 -07:00
webglrenderingcontext.rs Auto merge of #6812 - ecoal95:webgl-fail, r=jdm 2015-07-29 15:29:58 -06:00
webglshader.rs script: Make most of 2D canvas and WebGL run over IPC. 2015-07-25 00:50:12 -07:00
webglshaderprecisionformat.rs Add spec links 2015-07-28 13:28:41 +02:00
webgltexture.rs script: Make most of 2D canvas and WebGL run over IPC. 2015-07-25 00:50:12 -07:00
webgluniformlocation.rs webgl: Refactor implementation to move logic inside the DOM interfaces 2015-07-06 19:54:05 +02:00
websocket.rs Add spec links 2015-07-28 13:28:41 +02:00
window.rs script: Fix test failures. 2015-07-31 15:03:39 -07:00
worker.rs Add spec links 2015-07-28 13:28:41 +02:00
workerglobalscope.rs Add spec links 2015-07-28 13:28:41 +02:00
workerlocation.rs Implement URL and trivially missing URLUtils members 2015-06-20 15:17:55 +02:00
workernavigator.rs Add spec links 2015-07-28 13:28:41 +02:00
xmlhttprequest.rs script: Make the resource task communication use IPC channels. 2015-07-31 11:28:09 -07:00
xmlhttprequesteventtarget.rs Refactor #[jstraceable] to #[derive(JSTraceable)] 2015-07-01 18:27:06 -04:00
xmlhttprequestupload.rs Upgrade to SM 39 2015-06-19 18:42:48 -04:00