servo/components/script
bors-servo 2c259f477c auto merge of #4057 : jdm/servo/refcountdom, r=Ms2ger
This replaces the specialized TrustedXHRAddress and TrustedWorkerAddress code that was used for the same purpose. A non-zero refcount pins the given DOM object's reflector and prevents it from being GCed even when there are no other outstanding references visible to SpiderMonkey. This will enable us to implement asynchronous operations that refer to particular DOM objects (such as "queue a task to fire a simple event named load at the iframe element" from the spec) safely and conveniently, and paves the way for things like asynchronous network responses.

Some concerns about the resulting size of XHR progress messages have been expressed, but I believe optimizations to reduce that can be implemented in subsequent PRs.

r? @Ms2ger - note in particular the changes to the worker lifetime code. I couldn't figure out how to achieve an identical lifetime to the previous addref/release pairing, and I also was having trouble figuring out why the existing setup was safe. The new implementation now holds the main script task Worker object alive via the TrustedWorkerAddress field in the dedicated worker global scope, which is a significant difference.
2014-12-29 11:57:45 -07:00
..
dom auto merge of #4057 : jdm/servo/refcountdom, r=Ms2ger 2014-12-29 11:57:45 -07:00
parse Use parse_html in DOMParser. 2014-12-17 17:40:38 -10:00
Cargo.toml Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
cors.rs Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
devtools.rs Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
layout_interface.rs script: Remove glob imports added in #4405 2014-12-19 04:52:48 +09:00
lib.rs Allow refcounting arbitrary DOM objects in concert with the GC to enable safe, asynchronous/cross-task references to pinned objects. 2014-12-29 13:53:48 -05:00
makefile.cargo Cargoify servo 2014-09-08 20:21:42 -06:00
page.rs script: Remove glob imports added in #4405 2014-12-19 04:52:48 +09:00
script_task.rs auto merge of #4057 : jdm/servo/refcountdom, r=Ms2ger 2014-12-29 11:57:45 -07:00
tests.rs Implement HTMLElement.dataset (fixes #2974). 2014-12-23 14:24:06 +01:00
textinput.rs script: to_string() -> into_string() 2014-12-27 14:48:36 +01:00
timers.rs Force all messages to worker tasks to send a TrustedWorkerAddress along with the ScriptMsg. This ensures that the main-thread Worker object is rooted for as long as there are events in flight or being processed. 2014-12-29 13:53:49 -05:00