mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove usage of Gaol in the Windows configuration, since sandboxing is not supported there yet.
This commit is contained in:
parent
13d98f153a
commit
721693c43e
6 changed files with 43 additions and 9 deletions
|
@ -19,7 +19,9 @@ use compositor_thread::Msg as ToCompositorMsg;
|
|||
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
|
||||
use euclid::scale_factor::ScaleFactor;
|
||||
use euclid::size::{Size2D, TypedSize2D};
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use gaol;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use gaol::sandbox::{self, Sandbox, SandboxMethods};
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use gfx_traits::{Epoch, PaintMsg as FromPaintMsg};
|
||||
|
@ -40,6 +42,7 @@ use offscreen_gl_context::GLContextAttributes;
|
|||
use pipeline::{CompositionPipeline, InitialPipelineState, Pipeline, UnprivilegedPipelineContent};
|
||||
use profile_traits::mem;
|
||||
use profile_traits::time;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use sandboxing;
|
||||
use script_traits::{AnimationState, CompositorEvent, ConstellationControlMsg};
|
||||
use script_traits::{DocumentState, LayoutControlMsg};
|
||||
|
@ -282,6 +285,7 @@ enum ExitPipelineMode {
|
|||
}
|
||||
|
||||
enum ChildProcess {
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
Sandboxed(gaol::platform::process::Process),
|
||||
Unsandboxed(process::Child),
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ extern crate core_graphics;
|
|||
extern crate core_text;
|
||||
extern crate devtools_traits;
|
||||
extern crate euclid;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
extern crate gaol;
|
||||
extern crate gfx;
|
||||
extern crate gfx_traits;
|
||||
|
@ -66,6 +67,7 @@ pub mod compositor_thread;
|
|||
pub mod constellation;
|
||||
mod headless;
|
||||
pub mod pipeline;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
pub mod sandboxing;
|
||||
mod scrolling;
|
||||
mod surface_map;
|
||||
|
|
4
components/servo/Cargo.lock
generated
4
components/servo/Cargo.lock
generated
|
@ -67,9 +67,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
[[package]]
|
||||
name = "angle"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/ecoal95/angle?branch=servo#2c14c35cdc223eb95efcaf6830d339db5b535d76"
|
||||
source = "git+https://github.com/ecoal95/angle?branch=servo#b31e70ef5cb675582de910d09b0c385ea2000a64"
|
||||
dependencies = [
|
||||
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -125,7 +125,22 @@ optional = true
|
|||
version = "0.3"
|
||||
features = ["release_max_level_info"]
|
||||
|
||||
[dependencies.gaol]
|
||||
[target.arm-linux-androideabi.dependencies.gaol]
|
||||
git = "https://github.com/pcwalton/gaol"
|
||||
|
||||
[target.x86_64-apple-darwin.dependencies.gaol]
|
||||
git = "https://github.com/pcwalton/gaol"
|
||||
|
||||
[target.x86_64-unknown-linux.dependencies.gaol]
|
||||
git = "https://github.com/pcwalton/gaol"
|
||||
|
||||
[target.i686-unknown-linux-gnu.dependencies.gaol]
|
||||
git = "https://github.com/pcwalton/gaol"
|
||||
|
||||
[target.arm-unknown-linux-gnueabihf.dependencies.gaol]
|
||||
git = "https://github.com/pcwalton/gaol"
|
||||
|
||||
[target.aarch64-unknown-linux-gnueabihf.dependencies.gaol]
|
||||
git = "https://github.com/pcwalton/gaol"
|
||||
|
||||
[dependencies.ipc-channel]
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
//! The `Browser` is fed events from a generic type that implements the
|
||||
//! `WindowMethods` trait.
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
extern crate gaol;
|
||||
#[macro_use]
|
||||
extern crate util as _util;
|
||||
|
@ -60,10 +61,12 @@ use compositing::CompositorMsg as ConstellationMsg;
|
|||
use compositing::compositor_thread::InitialCompositorState;
|
||||
use compositing::constellation::InitialConstellationState;
|
||||
use compositing::pipeline::UnprivilegedPipelineContent;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use compositing::sandboxing;
|
||||
use compositing::windowing::WindowEvent;
|
||||
use compositing::windowing::WindowMethods;
|
||||
use compositing::{CompositorProxy, CompositorThread, Constellation};
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
|
@ -243,7 +246,7 @@ pub fn run_content_process(token: String) {
|
|||
|
||||
// Enter the sandbox if necessary.
|
||||
if opts::get().sandbox {
|
||||
ChildSandbox::new(sandboxing::content_process_sandbox_profile()).activate().unwrap();
|
||||
create_sandbox();
|
||||
}
|
||||
|
||||
script::init();
|
||||
|
@ -261,3 +264,13 @@ pub unsafe extern fn __errno_location() -> *mut i32 {
|
|||
extern { fn __errno() -> *mut i32; }
|
||||
__errno()
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn create_sandbox() {
|
||||
ChildSandbox::new(sandboxing::content_process_sandbox_profile()).activate().unwrap();
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn create_sandbox() {
|
||||
panic!("Sandboxing is not supported on Windows.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue