Skip to content

Commit

Permalink
Simplify handle_load_start_msg function
Browse files Browse the repository at this point in the history
  • Loading branch information
mukilan committed Jun 5, 2015
1 parent ad5846f commit 6413526
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions components/compositing/constellation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,19 +689,11 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
}

fn handle_load_start_msg(&mut self, pipeline_id: &PipelineId) {
let mut back;
let mut forward;
let frameid = self.pipeline_to_frame_map.get(pipeline_id);
match frameid {
Some(frame_id) => {
forward = if !self.frame(*frame_id).next.is_empty() { true }
else { false };
back = if !self.frame(*frame_id).prev.is_empty() { true }
else { false };
},
None => return
};
self.compositor_proxy.send(CompositorMsg::LoadStart(back, forward));
if let Some(id) = self.pipeline_to_frame_map.get(pipeline_id) {
let forward = !self.frame(*id).next.is_empty();
let back = !self.frame(*id).prev.is_empty();
self.compositor_proxy.send(CompositorMsg::LoadStart(back, forward));
}
}

fn handle_load_complete_msg(&mut self, pipeline_id: &PipelineId) {
Expand All @@ -710,8 +702,8 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
None => return
};

let forward = !self.mut_frame(frame_id).next.is_empty();
let back = !self.mut_frame(frame_id).prev.is_empty();
let forward = !self.frame(frame_id).next.is_empty();
let back = !self.frame(frame_id).prev.is_empty();
self.compositor_proxy.send(CompositorMsg::LoadComplete(back, forward));

let mut webdriver_reset = false;
Expand Down

0 comments on commit 6413526

Please sign in to comment.