Skip to content

Commit

Permalink
Move sandboxing into the constellation crate.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed May 22, 2016
1 parent f1efeb0 commit f4c4977
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 16 deletions.
3 changes: 0 additions & 3 deletions components/compositing/Cargo.toml
Expand Up @@ -33,6 +33,3 @@ serde = "0.7"
serde_macros = "0.7"
time = "0.1.17"
url = {version = "1.0.0", features = ["heap_size"]}

[target.'cfg(not(target_os = "windows"))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}
4 changes: 0 additions & 4 deletions components/compositing/lib.rs
Expand Up @@ -15,8 +15,6 @@ extern crate app_units;

extern crate azure;
extern crate euclid;
#[cfg(not(target_os = "windows"))]
extern crate gaol;
extern crate gfx;
extern crate gfx_traits;
extern crate gleam;
Expand Down Expand Up @@ -59,8 +57,6 @@ mod compositor;
mod compositor_layer;
pub mod compositor_thread;
mod delayed_composition;
#[cfg(not(target_os = "windows"))]
pub mod sandboxing;
mod surface_map;
mod touch;
pub mod windowing;
Expand Down
6 changes: 3 additions & 3 deletions components/constellation/constellation.rs
Expand Up @@ -16,8 +16,6 @@ use clipboard::ClipboardContext;
use compositing::CompositorMsg as FromCompositorMsg;
use compositing::compositor_thread::CompositorProxy;
use compositing::compositor_thread::Msg as ToCompositorMsg;
#[cfg(not(target_os = "windows"))]
use compositing::sandboxing;
use compositing::{AnimationTickType, SendableFrameTree};
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
use euclid::scale_factor::ScaleFactor;
Expand Down Expand Up @@ -49,6 +47,8 @@ use pipeline::{InitialPipelineState, Pipeline, UnprivilegedPipelineContent};
use profile_traits::mem;
use profile_traits::time;
use rand::{random, Rng, SeedableRng, StdRng};
#[cfg(not(target_os = "windows"))]
use sandboxing::content_process_sandbox_profile;
use script_traits::{AnimationState, CompositorEvent, ConstellationControlMsg};
use script_traits::{DocumentState, LayoutControlMsg};
use script_traits::{IFrameLoadInfo, IFrameSandboxState, TimerEventRequest};
Expand Down Expand Up @@ -482,7 +482,7 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
command.env("RUST_BACKTRACE", value);
}

let profile = sandboxing::content_process_sandbox_profile();
let profile = content_process_sandbox_profile();
ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command)
.expect("Failed to start sandboxed child process!"))
} else {
Expand Down
3 changes: 3 additions & 0 deletions components/constellation/lib.rs
Expand Up @@ -43,7 +43,10 @@ extern crate webrender_traits;

mod constellation;
mod pipeline;
#[cfg(not(target_os = "windows"))]
mod sandboxing;
mod timer_scheduler;

pub use constellation::{Constellation, InitialConstellationState};
pub use pipeline::UnprivilegedPipelineContent;
pub use sandboxing::content_process_sandbox_profile;
File renamed without changes.
1 change: 0 additions & 1 deletion components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions components/servo/lib.rs
Expand Up @@ -60,11 +60,11 @@ fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) { }
use compositing::CompositorEventListener;
use compositing::CompositorMsg as ConstellationMsg;
use compositing::compositor_thread::InitialCompositorState;
#[cfg(not(target_os = "windows"))]
use compositing::sandboxing;
use compositing::windowing::WindowEvent;
use compositing::windowing::WindowMethods;
use compositing::{CompositorProxy, CompositorThread};
#[cfg(not(target_os = "windows"))]
use constellation::content_process_sandbox_profile;
use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent};
#[cfg(not(target_os = "windows"))]
use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
Expand Down Expand Up @@ -280,7 +280,7 @@ pub unsafe extern fn __errno_location() -> *mut i32 {

#[cfg(not(target_os = "windows"))]
fn create_sandbox() {
ChildSandbox::new(sandboxing::content_process_sandbox_profile()).activate()
ChildSandbox::new(content_process_sandbox_profile()).activate()
.expect("Failed to activate sandbox!");
}

Expand Down
1 change: 0 additions & 1 deletion ports/cef/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ports/gonk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f4c4977

Please sign in to comment.