servo/components/script
bors-servo 16b0da5004 Auto merge of #14312 - asajeffrey:script-discard-documents, r=cbrewster
Implement discarding Document objects to reclaim space.

<!-- Please describe your changes on the following line: -->

This PR implements document discarding. Active documents are kept alive strongly, but inactive documents are only kept alive weakly. When a document is GCd, it is marked as discarded, and if it is every reactivated, a reload of the URL is triggered.

Note that this PR is pretty aggressive about discarding, and can any inactive document (other than those being kept alive by other same-origin pipelines). We might want to damp it down a bit.

Also note that this interacts with browser.html in that the reloading triggered by reactivating a document triggers mozbrowser events.

To test this, I added a `-Zdiscard-inactive-documents` debug flag, which discards all inactive documents, even ones which are reachable through other same-origin pipelines.

---
<!-- 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 #14262.
- [X] These changes do not require tests because we should be able to use the existing tests with `-Zdiscard-inactive-documents`.

<!-- 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/14312)
<!-- Reviewable:end -->
2017-01-04 13:58:57 -08:00
..
docs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
dom Auto merge of #14312 - asajeffrey:script-discard-documents, r=cbrewster 2017-01-04 13:58:57 -08:00
task_source Properly implement TaskSource for NetworkingTaskSource 2016-11-11 14:50:42 -08:00
body.rs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
build.rs Native MSVC windows build, convert to cmake 2016-08-17 09:50:51 -04:00
Cargo.toml Switch to crates.io for atomic_refcell. 2017-01-03 18:14:27 -08:00
clipboard_provider.rs Remove ConstellationChan. 2016-05-19 17:13:44 +02:00
CMakeLists.txt Fix doc build by resurrecting generation of supported DOM APIs.h 2016-09-24 15:06:06 -04:00
devtools.rs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
document_loader.rs Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
fetch.rs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
layout_wrapper.rs Only pass nodes to layout for restyling that are actually in the document. 2017-01-04 12:42:12 -05:00
lib.rs Switch to crates.io for atomic_refcell. 2017-01-03 18:14:27 -08:00
mem.rs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
network_listener.rs Separate the async bluetooth handling from networking code. 2016-12-21 14:52:39 +01:00
origin.rs Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
script_runtime.rs Removed util. 2016-12-14 18:04:37 -06:00
script_thread.rs Implement discarding Document objects to reclaim space. 2017-01-04 11:29:31 +00:00
serviceworker_manager.rs Removed util. 2016-12-14 18:04:37 -06:00
serviceworkerjob.rs Rename Reflectable to DomObject. 2016-12-08 08:50:35 -10:00
stylesheet_loader.rs Interact with the originating document for stylesheet loads, rather than the element's current document. 2017-01-04 09:55:45 -05:00
test.rs Remove generation, remove filter pop, and add size tests. 2016-12-22 11:09:55 -08:00
textinput.rs Return KeyReaction::Nothing for a Tab event 2016-11-12 15:49:00 +01:00
timers.rs Added warnings for idempotent freeze/thaw. 2017-01-04 13:56:14 +00:00
unpremultiplytable.rs
webdriver_handlers.rs Refactor and simplify 'set cookies' operations on resource thread. 2016-12-15 15:34:04 -05:00