aboutsummaryrefslogtreecommitdiffstats
path: root/components/constellation/pipeline.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-24 08:33:41 -0700
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-24 08:33:41 -0700
commite4fe0db8fd5f0b5431ba3856b4931613a96e924e (patch)
tree8a6f0ed2ba460df5c418ace3a9f1ef27f9160730 /components/constellation/pipeline.rs
parent8c4929a196ca933532d0c6948c9eebd92be4013a (diff)
parentc1ff09654a2d5457285945d2becc3abb292a59bb (diff)
downloadservo-e4fe0db8fd5f0b5431ba3856b4931613a96e924e.tar.gz
servo-e4fe0db8fd5f0b5431ba3856b4931613a96e924e.zip
Auto merge of #11371 - Ms2ger:pipeline-create, r=asajeffrey
Avoid an unnecessary runtime check in Pipeline::create(). Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). Either: - [ ] There are tests for these changes OR - [x] These changes do not require tests because refactoring Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11371) <!-- Reviewable:end -->
Diffstat (limited to 'components/constellation/pipeline.rs')
-rw-r--r--components/constellation/pipeline.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs
index 8f9252bd263..dcab55b3656 100644
--- a/components/constellation/pipeline.rs
+++ b/components/constellation/pipeline.rs
@@ -130,7 +130,6 @@ impl Pipeline {
.expect("Pipeline main chan");;
let (script_to_compositor_chan, script_to_compositor_port) = ipc::channel()
.expect("Pipeline script to compositor chan");
- let mut pipeline_port = Some(pipeline_port);
let window_size = state.window_size.map(|size| {
WindowSizeData {
@@ -159,7 +158,7 @@ impl Pipeline {
let (layout_content_process_shutdown_chan, layout_content_process_shutdown_port) =
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) => {
let (containing_pipeline_id, subpage_id) =
state.parent_info.expect("script_pipeline != None but subpage_id == None");
@@ -170,8 +169,7 @@ impl Pipeline {
load_data: state.load_data.clone(),
paint_chan: layout_to_paint_chan.clone().to_opaque(),
panic_chan: state.panic_chan.clone(),
- pipeline_port: mem::replace(&mut pipeline_port, None)
- .expect("script_pipeline != None but pipeline_port == None"),
+ pipeline_port: pipeline_port,
layout_shutdown_chan: layout_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)) {
warn!("Sending to script during pipeline creation failed ({})", e);
}
- (script_chan, None)
+ (script_chan, None, None)
}
None => {
let (script_chan, script_port) = ipc::channel().expect("Pipeline script chan");
- (script_chan, Some(script_port))
+ (script_chan, Some(script_port), Some(pipeline_port))
}
};