mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Disable gaol on android
This commit is contained in:
parent
71f9619e60
commit
16beb65d49
5 changed files with 32 additions and 10 deletions
|
@ -45,5 +45,5 @@ servo_url = {path = "../url"}
|
||||||
webvr_traits = {path = "../webvr_traits"}
|
webvr_traits = {path = "../webvr_traits"}
|
||||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||||
|
|
||||||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios")))'.dependencies]
|
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android")))'.dependencies]
|
||||||
gaol = {git = "https://github.com/servo/gaol"}
|
gaol = {git = "https://github.com/servo/gaol"}
|
||||||
|
|
|
@ -17,7 +17,7 @@ mod constellation;
|
||||||
mod event_loop;
|
mod event_loop;
|
||||||
mod network_listener;
|
mod network_listener;
|
||||||
mod pipeline;
|
mod pipeline;
|
||||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
#[cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android")))]
|
||||||
mod sandboxing;
|
mod sandboxing;
|
||||||
mod session_history;
|
mod session_history;
|
||||||
mod timer_scheduler;
|
mod timer_scheduler;
|
||||||
|
@ -26,5 +26,5 @@ pub use crate::constellation::{
|
||||||
Constellation, FromCompositorLogger, FromScriptLogger, InitialConstellationState,
|
Constellation, FromCompositorLogger, FromScriptLogger, InitialConstellationState,
|
||||||
};
|
};
|
||||||
pub use crate::pipeline::UnprivilegedPipelineContent;
|
pub use crate::pipeline::UnprivilegedPipelineContent;
|
||||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
#[cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android")))]
|
||||||
pub use crate::sandboxing::content_process_sandbox_profile;
|
pub use crate::sandboxing::content_process_sandbox_profile;
|
||||||
|
|
|
@ -571,7 +571,29 @@ impl UnprivilegedPipelineContent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
#[cfg(target_os = "android")]
|
||||||
|
pub fn spawn_multiprocess(self) -> Result<(), Error> {
|
||||||
|
use ipc_channel::ipc::IpcOneShotServer;
|
||||||
|
// Note that this function can panic, due to process creation,
|
||||||
|
// avoiding this panic would require a mechanism for dealing
|
||||||
|
// with low-resource scenarios.
|
||||||
|
let (server, token) = IpcOneShotServer::<IpcSender<UnprivilegedPipelineContent>>::new()
|
||||||
|
.expect("Failed to create IPC one-shot server.");
|
||||||
|
|
||||||
|
let path_to_self = env::current_exe().expect("Failed to get current executor.");
|
||||||
|
let mut child_process = process::Command::new(path_to_self);
|
||||||
|
self.setup_common(&mut child_process, token);
|
||||||
|
let _ = child_process
|
||||||
|
.spawn()
|
||||||
|
.expect("Failed to start unsandboxed child process!");
|
||||||
|
|
||||||
|
let (_receiver, sender) = server.accept().expect("Server failed to accept.");
|
||||||
|
sender.send(self)?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android")))]
|
||||||
pub fn spawn_multiprocess(self) -> Result<(), Error> {
|
pub fn spawn_multiprocess(self) -> Result<(), Error> {
|
||||||
use crate::sandboxing::content_process_sandbox_profile;
|
use crate::sandboxing::content_process_sandbox_profile;
|
||||||
use gaol::sandbox::{self, Sandbox, SandboxMethods};
|
use gaol::sandbox::{self, Sandbox, SandboxMethods};
|
||||||
|
|
|
@ -71,5 +71,5 @@ webdriver_server = {path = "../webdriver_server", optional = true}
|
||||||
webvr = {path = "../webvr"}
|
webvr = {path = "../webvr"}
|
||||||
webvr_traits = {path = "../webvr_traits"}
|
webvr_traits = {path = "../webvr_traits"}
|
||||||
|
|
||||||
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios")))'.dependencies]
|
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android")))'.dependencies]
|
||||||
gaol = {git = "https://github.com/servo/gaol"}
|
gaol = {git = "https://github.com/servo/gaol"}
|
||||||
|
|
|
@ -68,14 +68,14 @@ use canvas::webgl_thread::WebGLThreads;
|
||||||
use compositing::compositor_thread::{CompositorProxy, CompositorReceiver, InitialCompositorState};
|
use compositing::compositor_thread::{CompositorProxy, CompositorReceiver, InitialCompositorState};
|
||||||
use compositing::windowing::{WindowEvent, WindowMethods};
|
use compositing::windowing::{WindowEvent, WindowMethods};
|
||||||
use compositing::{IOCompositor, RenderNotifier, ShutdownState};
|
use compositing::{IOCompositor, RenderNotifier, ShutdownState};
|
||||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
#[cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android")))]
|
||||||
use constellation::content_process_sandbox_profile;
|
use constellation::content_process_sandbox_profile;
|
||||||
use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent};
|
use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent};
|
||||||
use constellation::{FromCompositorLogger, FromScriptLogger};
|
use constellation::{FromCompositorLogger, FromScriptLogger};
|
||||||
use crossbeam_channel::{unbounded, Sender};
|
use crossbeam_channel::{unbounded, Sender};
|
||||||
use embedder_traits::{EmbedderMsg, EmbedderProxy, EmbedderReceiver, EventLoopWaker};
|
use embedder_traits::{EmbedderMsg, EmbedderProxy, EmbedderReceiver, EventLoopWaker};
|
||||||
use env_logger::Builder as EnvLoggerBuilder;
|
use env_logger::Builder as EnvLoggerBuilder;
|
||||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
#[cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android")))]
|
||||||
use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
|
use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
|
||||||
use gfx::font_cache_thread::FontCacheThread;
|
use gfx::font_cache_thread::FontCacheThread;
|
||||||
use ipc_channel::ipc::{self, IpcSender};
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
|
@ -661,14 +661,14 @@ pub fn run_content_process(token: String) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
#[cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os = "android")))]
|
||||||
fn create_sandbox() {
|
fn create_sandbox() {
|
||||||
ChildSandbox::new(content_process_sandbox_profile())
|
ChildSandbox::new(content_process_sandbox_profile())
|
||||||
.activate()
|
.activate()
|
||||||
.expect("Failed to activate sandbox!");
|
.expect("Failed to activate sandbox!");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "windows", target_os = "ios"))]
|
#[cfg(any(target_os = "windows", target_os = "ios", target_os = "android"))]
|
||||||
fn create_sandbox() {
|
fn create_sandbox() {
|
||||||
panic!("Sandboxing is not supported on Windows or iOS.");
|
panic!("Sandboxing is not supported on Windows, iOS and android.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue