mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
adding check for windows then using Scripts instead of bin
This commit is contained in:
parent
095658e098
commit
13d98f153a
6 changed files with 61 additions and 41 deletions
|
@ -63,7 +63,22 @@ git = "https://github.com/servo/ipc-channel"
|
|||
[dependencies.offscreen_gl_context]
|
||||
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
|
||||
|
||||
[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-gnu.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]
|
||||
|
|
|
@ -406,27 +406,7 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
|||
//
|
||||
// Yes, that's all there is to it!
|
||||
if opts::multiprocess() {
|
||||
let (server, token) =
|
||||
IpcOneShotServer::<IpcSender<UnprivilegedPipelineContent>>::new().unwrap();
|
||||
|
||||
// If there is a sandbox, use the `gaol` API to create the child process.
|
||||
let child_process = if opts::get().sandbox {
|
||||
let mut command = sandbox::Command::me().unwrap();
|
||||
command.arg("--content-process").arg(token);
|
||||
let profile = sandboxing::content_process_sandbox_profile();
|
||||
ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command).expect(
|
||||
"Failed to start sandboxed child process!"))
|
||||
} else {
|
||||
let path_to_self = env::current_exe().unwrap();
|
||||
let mut child_process = process::Command::new(path_to_self);
|
||||
child_process.arg("--content-process");
|
||||
child_process.arg(token);
|
||||
ChildProcess::Unsandboxed(child_process.spawn().unwrap())
|
||||
};
|
||||
self.child_processes.push(child_process);
|
||||
|
||||
let (_receiver, sender) = server.accept().unwrap();
|
||||
sender.send(unprivileged_pipeline_content).unwrap();
|
||||
self.spawn_multiprocess(unprivileged_pipeline_content);
|
||||
} else {
|
||||
unprivileged_pipeline_content.start_all::<LTF, STF>(false);
|
||||
}
|
||||
|
@ -436,6 +416,36 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
|||
self.pipelines.insert(pipeline_id, pipeline);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn spawn_multiprocess(&mut self, unprivileged_pipeline_content: UnprivilegedPipelineContent) {
|
||||
let (server, token) =
|
||||
IpcOneShotServer::<IpcSender<UnprivilegedPipelineContent>>::new().unwrap();
|
||||
|
||||
// If there is a sandbox, use the `gaol` API to create the child process.
|
||||
let child_process = if opts::get().sandbox {
|
||||
let mut command = sandbox::Command::me().unwrap();
|
||||
command.arg("--content-process").arg(token);
|
||||
let profile = sandboxing::content_process_sandbox_profile();
|
||||
ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command).expect(
|
||||
"Failed to start sandboxed child process!"))
|
||||
} else {
|
||||
let path_to_self = env::current_exe().unwrap();
|
||||
let mut child_process = process::Command::new(path_to_self);
|
||||
child_process.arg("--content-process");
|
||||
child_process.arg(token);
|
||||
ChildProcess::Unsandboxed(child_process.spawn().unwrap())
|
||||
};
|
||||
|
||||
self.child_processes.push(child_process);
|
||||
let (_receiver, sender) = server.accept().unwrap();
|
||||
sender.send(unprivileged_pipeline_content).unwrap();
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn spawn_multiprocess(&mut self, _: UnprivilegedPipelineContent) {
|
||||
panic!("Multiprocess is not supported on Windows.");
|
||||
}
|
||||
|
||||
// Push a new (loading) pipeline to the list of pending frame changes
|
||||
fn push_pending_frame(&mut self, new_pipeline_id: PipelineId,
|
||||
old_pipeline_id: Option<PipelineId>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue