2016-05-18 12:11:46 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2017-02-21 16:15:15 +03:00
|
|
|
#![deny(unsafe_code)]
|
2016-05-18 12:11:46 +03:00
|
|
|
#![feature(box_syntax)]
|
servo: Merge #14312 - Implement discarding Document objects to reclaim space (from asajeffrey:script-discard-documents); r=cbrewster
<!-- 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. -->
Source-Repo: https://github.com/servo/servo
Source-Revision: 16b0da5004fd730de87883daa35a78b6af01f042
2017-01-05 00:58:57 +03:00
|
|
|
#![feature(conservative_impl_trait)]
|
2016-05-18 12:11:46 +03:00
|
|
|
#![feature(mpsc_select)]
|
|
|
|
|
2016-07-15 22:22:26 +03:00
|
|
|
extern crate backtrace;
|
2016-11-03 23:04:43 +03:00
|
|
|
extern crate bluetooth_traits;
|
2016-05-18 12:11:46 +03:00
|
|
|
extern crate canvas;
|
|
|
|
extern crate canvas_traits;
|
2017-06-01 20:07:16 +03:00
|
|
|
extern crate clipboard;
|
2016-05-18 12:11:46 +03:00
|
|
|
extern crate compositing;
|
2016-11-07 21:47:58 +03:00
|
|
|
extern crate debugger;
|
2016-05-18 12:11:46 +03:00
|
|
|
extern crate devtools_traits;
|
|
|
|
extern crate euclid;
|
|
|
|
#[cfg(not(target_os = "windows"))]
|
|
|
|
extern crate gaol;
|
|
|
|
extern crate gfx;
|
|
|
|
extern crate gfx_traits;
|
|
|
|
extern crate ipc_channel;
|
2017-04-07 05:22:14 +03:00
|
|
|
extern crate itertools;
|
2016-05-18 12:11:46 +03:00
|
|
|
extern crate layout_traits;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
extern crate msg;
|
2017-03-27 23:50:46 +03:00
|
|
|
extern crate net;
|
2016-05-18 12:11:46 +03:00
|
|
|
extern crate net_traits;
|
|
|
|
extern crate offscreen_gl_context;
|
|
|
|
extern crate profile_traits;
|
|
|
|
extern crate script_traits;
|
2017-02-20 18:09:14 +03:00
|
|
|
extern crate serde;
|
2016-10-10 04:12:38 +03:00
|
|
|
#[macro_use]
|
|
|
|
extern crate serde_derive;
|
2016-12-15 03:48:42 +03:00
|
|
|
extern crate servo_config;
|
2017-01-05 17:32:23 +03:00
|
|
|
extern crate servo_rand;
|
2016-12-15 03:48:42 +03:00
|
|
|
extern crate servo_remutex;
|
2016-11-18 00:34:47 +03:00
|
|
|
extern crate servo_url;
|
2016-05-18 12:11:46 +03:00
|
|
|
extern crate style_traits;
|
|
|
|
extern crate webrender_traits;
|
2017-01-09 17:39:45 +03:00
|
|
|
extern crate webvr_traits;
|
2016-05-18 12:11:46 +03:00
|
|
|
|
2017-05-17 07:10:45 +03:00
|
|
|
mod browsingcontext;
|
2016-05-18 12:11:46 +03:00
|
|
|
mod constellation;
|
2016-12-16 02:02:37 +03:00
|
|
|
mod event_loop;
|
2016-05-21 17:34:22 +03:00
|
|
|
mod pipeline;
|
2016-05-22 16:43:56 +03:00
|
|
|
#[cfg(not(target_os = "windows"))]
|
|
|
|
mod sandboxing;
|
2016-05-18 12:11:46 +03:00
|
|
|
mod timer_scheduler;
|
|
|
|
|
2016-07-15 22:22:26 +03:00
|
|
|
pub use constellation::{Constellation, FromCompositorLogger, FromScriptLogger, InitialConstellationState};
|
2016-05-21 17:34:22 +03:00
|
|
|
pub use pipeline::UnprivilegedPipelineContent;
|
2016-05-22 16:43:56 +03:00
|
|
|
#[cfg(not(target_os = "windows"))]
|
|
|
|
pub use sandboxing::content_process_sandbox_profile;
|