diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index d11129794d1..e45904dc77e 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -120,11 +120,15 @@ pub struct InitialPipelineState { } impl Pipeline { - fn create(state: InitialPipelineState) - -> (Pipeline, UnprivilegedPipelineContent, PrivilegedPipelineContent) - where LTF: LayoutThreadFactory, - STF: ScriptThreadFactory + /// Starts a paint thread, layout thread, and possibly a script thread, in + /// a new process if requested. + pub fn spawn(state: InitialPipelineState) + -> Result<(Pipeline, Option), IOError> + where LTF: LayoutThreadFactory, + STF: ScriptThreadFactory { + let spawning_content = state.script_chan.is_none(); + // Note: we allow channel creation to panic, since recovering from this // probably requires a general low-memory strategy. let (layout_to_paint_chan, layout_to_paint_port) = util::ipc::optional_ipc_channel(); @@ -251,20 +255,6 @@ impl Pipeline { paint_shutdown_chan: paint_shutdown_chan, }; - (pipeline, unprivileged_pipeline_content, privileged_pipeline_content) - } - - /// Starts a paint thread, layout thread, and possibly a script thread, in - /// a new process if requested. - pub fn spawn(state: InitialPipelineState) - -> Result<(Pipeline, Option), IOError> - where LTF: LayoutThreadFactory, - STF: ScriptThreadFactory - { - let spawning_content = state.script_chan.is_none(); - let (pipeline, unprivileged_pipeline_content, privileged_pipeline_content) = - Pipeline::create::(state); - privileged_pipeline_content.start(); let mut child_process = None;