mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Avoid an unnecessary runtime check in Pipeline::create().
This commit is contained in:
parent
2ce9eba3dc
commit
c1ff09654a
1 changed files with 4 additions and 6 deletions
|
@ -130,7 +130,6 @@ impl Pipeline {
|
||||||
.expect("Pipeline main chan");;
|
.expect("Pipeline main chan");;
|
||||||
let (script_to_compositor_chan, script_to_compositor_port) = ipc::channel()
|
let (script_to_compositor_chan, script_to_compositor_port) = ipc::channel()
|
||||||
.expect("Pipeline script to compositor chan");
|
.expect("Pipeline script to compositor chan");
|
||||||
let mut pipeline_port = Some(pipeline_port);
|
|
||||||
|
|
||||||
let window_size = state.window_size.map(|size| {
|
let window_size = state.window_size.map(|size| {
|
||||||
WindowSizeData {
|
WindowSizeData {
|
||||||
|
@ -159,7 +158,7 @@ impl Pipeline {
|
||||||
let (layout_content_process_shutdown_chan, layout_content_process_shutdown_port) =
|
let (layout_content_process_shutdown_chan, layout_content_process_shutdown_port) =
|
||||||
ipc::channel().expect("Pipeline layout content shutdown chan");
|
ipc::channel().expect("Pipeline layout content shutdown chan");
|
||||||
|
|
||||||
let (script_chan, script_port) = match state.script_chan {
|
let (script_chan, script_port, pipeline_port) = match state.script_chan {
|
||||||
Some(script_chan) => {
|
Some(script_chan) => {
|
||||||
let (containing_pipeline_id, subpage_id) =
|
let (containing_pipeline_id, subpage_id) =
|
||||||
state.parent_info.expect("script_pipeline != None but subpage_id == None");
|
state.parent_info.expect("script_pipeline != None but subpage_id == None");
|
||||||
|
@ -170,8 +169,7 @@ impl Pipeline {
|
||||||
load_data: state.load_data.clone(),
|
load_data: state.load_data.clone(),
|
||||||
paint_chan: layout_to_paint_chan.clone().to_opaque(),
|
paint_chan: layout_to_paint_chan.clone().to_opaque(),
|
||||||
panic_chan: state.panic_chan.clone(),
|
panic_chan: state.panic_chan.clone(),
|
||||||
pipeline_port: mem::replace(&mut pipeline_port, None)
|
pipeline_port: pipeline_port,
|
||||||
.expect("script_pipeline != None but pipeline_port == None"),
|
|
||||||
layout_shutdown_chan: layout_shutdown_chan.clone(),
|
layout_shutdown_chan: layout_shutdown_chan.clone(),
|
||||||
content_process_shutdown_chan: layout_content_process_shutdown_chan.clone(),
|
content_process_shutdown_chan: layout_content_process_shutdown_chan.clone(),
|
||||||
};
|
};
|
||||||
|
@ -179,11 +177,11 @@ impl Pipeline {
|
||||||
if let Err(e) = script_chan.send(ConstellationControlMsg::AttachLayout(new_layout_info)) {
|
if let Err(e) = script_chan.send(ConstellationControlMsg::AttachLayout(new_layout_info)) {
|
||||||
warn!("Sending to script during pipeline creation failed ({})", e);
|
warn!("Sending to script during pipeline creation failed ({})", e);
|
||||||
}
|
}
|
||||||
(script_chan, None)
|
(script_chan, None, None)
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let (script_chan, script_port) = ipc::channel().expect("Pipeline script chan");
|
let (script_chan, script_port) = ipc::channel().expect("Pipeline script chan");
|
||||||
(script_chan, Some(script_port))
|
(script_chan, Some(script_port), Some(pipeline_port))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue