aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/main.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2015-07-24 17:00:10 -0700
committerJosh Matthews <josh@joshmatthews.net>2015-11-19 16:38:04 -0500
commit1c130819ca6fdcef66495ea3dabf9d9575774d52 (patch)
treed5c58d9891ee0958aeeffdb04f86fd813fe0a4c3 /components/servo/main.rs
parentff4171170dba925b9036bf59af7dc17202273af1 (diff)
downloadservo-1c130819ca6fdcef66495ea3dabf9d9575774d52.tar.gz
servo-1c130819ca6fdcef66495ea3dabf9d9575774d52.zip
compositing: Split Servo up into multiple sandboxed processes.
Multiprocess mode is enabled with the `-M` switch, and sandboxing is enabled with the `-S` switch.
Diffstat (limited to 'components/servo/main.rs')
-rw-r--r--components/servo/main.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/components/servo/main.rs b/components/servo/main.rs
index 45a64d74784..437df310832 100644
--- a/components/servo/main.rs
+++ b/components/servo/main.rs
@@ -39,7 +39,7 @@ use offscreen_gl_context::GLContext;
use servo::Browser;
use servo::compositing::windowing::WindowEvent;
use servo::net_traits::hosts;
-use servo::util::opts;
+use servo::util::opts::{self, ArgumentParsingResult};
use std::rc::Rc;
#[cfg(not(target_os = "android"))]
@@ -52,11 +52,17 @@ fn load_gl_when_headless() {}
fn main() {
// Parse the command line options and store them globally
- opts::from_cmdline_args(&*args());
+ let opts_result = opts::from_cmdline_args(&*args());
- if opts::get().is_running_problem_test && ::std::env::var("RUST_LOG").is_err() {
- ::std::env::set_var("RUST_LOG", "compositing::constellation");
- }
+ let content_process_token = if let ArgumentParsingResult::ContentProcess(token) = opts_result {
+ Some(token)
+ } else {
+ if opts::get().is_running_problem_test && ::std::env::var("RUST_LOG").is_err() {
+ ::std::env::set_var("RUST_LOG", "compositing::constellation");
+ }
+
+ None
+ };
env_logger::init().unwrap();
@@ -65,6 +71,10 @@ fn main() {
// Possibly interpret the `HOST_FILE` environment variable
hosts::global_init();
+ if let Some(token) = content_process_token {
+ return servo::run_content_process(token)
+ }
+
let window = if opts::get().headless {
// Load gl functions even when in headless mode,
// to avoid crashing with webgl