Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First step toward iOS Support #18189

Merged
merged 1 commit into from Aug 23, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -41,5 +41,5 @@ servo_url = {path = "../url"}
webvr_traits = {path = "../webvr_traits"}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}

[target.'cfg(not(target_os = "windows"))'.dependencies]
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios")))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}
@@ -16,7 +16,7 @@ extern crate compositing;
extern crate debugger;
extern crate devtools_traits;
extern crate euclid;
#[cfg(not(target_os = "windows"))]
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
extern crate gaol;
extern crate gfx;
extern crate gfx_traits;
@@ -46,11 +46,11 @@ mod constellation;
mod event_loop;
mod network_listener;
mod pipeline;
#[cfg(not(target_os = "windows"))]
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
mod sandboxing;
mod timer_scheduler;

pub use constellation::{Constellation, FromCompositorLogger, FromScriptLogger, InitialConstellationState};
pub use pipeline::UnprivilegedPipelineContent;
#[cfg(not(target_os = "windows"))]
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
pub use sandboxing::content_process_sandbox_profile;
@@ -535,7 +535,7 @@ impl UnprivilegedPipelineContent {
}
}

#[cfg(not(target_os = "windows"))]
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
pub fn spawn_multiprocess(self) -> Result<(), Error> {
use gaol::sandbox::{self, Sandbox, SandboxMethods};
use ipc_channel::ipc::IpcOneShotServer;
@@ -583,9 +583,9 @@ impl UnprivilegedPipelineContent {
Ok(())
}

#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "ios"))]
pub fn spawn_multiprocess(self) -> Result<(), Error> {
error!("Multiprocess is not supported on Windows.");
error!("Multiprocess is not supported on Windows or iOS.");
process::exit(1);
}

@@ -24,7 +24,6 @@ serde_json = "1.0"
tinyfiledialogs = "2.5.9"

[dependencies]
angle = {git = "https://github.com/servo/angle", branch = "servo"}
app_units = "0.5"
audio-video-metadata = "0.1.2"
base64 = "0.5.2"
@@ -94,3 +93,6 @@ xml5ever = {version = "0.9"}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
webvr = {path = "../webvr"}
webvr_traits = {path = "../webvr_traits"}

[target.'cfg(not(target_os = "ios"))'.dependencies]
angle = {git = "https://github.com/servo/angle", branch = "servo"}
@@ -36,6 +36,11 @@ pub fn Platform() -> DOMString {
DOMString::from("Mac")
}

#[cfg(target_os = "ios")]
pub fn Platform() -> DOMString {
DOMString::from("iOS")
}

pub fn UserAgent() -> DOMString {
DOMString::from(&*opts::get().user_agent)
}
@@ -54,5 +54,5 @@ webdriver_server = {path = "../webdriver_server", optional = true}
webvr = {path = "../webvr"}
webvr_traits = {path = "../webvr_traits"}

[target.'cfg(not(target_os = "windows"))'.dependencies]
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios")))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}
@@ -18,7 +18,7 @@
//! `WindowMethods` trait.

extern crate env_logger;
#[cfg(not(target_os = "windows"))]
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
extern crate gaol;
extern crate gleam;
extern crate log;
@@ -76,10 +76,10 @@ use compositing::windowing::WindowEvent;
use compositing::windowing::WindowMethods;
use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent};
use constellation::{FromCompositorLogger, FromScriptLogger};
#[cfg(not(target_os = "windows"))]
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
use constellation::content_process_sandbox_profile;
use env_logger::Logger as EnvLogger;
#[cfg(not(target_os = "windows"))]
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
use gfx::font_cache_thread::FontCacheThread;
use ipc_channel::ipc::{self, IpcSender};
@@ -433,13 +433,13 @@ pub unsafe extern fn __errno_location() -> *mut i32 {
__errno()
}

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

#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "ios"))]
fn create_sandbox() {
panic!("Sandboxing is not supported on Windows.");
panic!("Sandboxing is not supported on Windows or iOS.");
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.