aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2016-09-20 14:01:56 +0200
committerMs2ger <Ms2ger@gmail.com>2016-09-20 14:01:56 +0200
commit61402b8ca790b350e028f1dad7ff270da4d16b3c (patch)
tree22e4507fc99f420256e6f3e815182f7bcbcf572f
parent53938c439f3a0c2b3c3d734346ca291e1eb703a5 (diff)
downloadservo-61402b8ca790b350e028f1dad7ff270da4d16b3c.tar.gz
servo-61402b8ca790b350e028f1dad7ff270da4d16b3c.zip
Inline push_pending_frame into its callers.
The recently added replace argument makes it less readable, especially with the second boolean argument I am adding in #11893.
-rw-r--r--components/constellation/constellation.rs40
1 files changed, 24 insertions, 16 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs
index 081f9c1eb4e..fa10a76bbdc 100644
--- a/components/constellation/constellation.rs
+++ b/components/constellation/constellation.rs
@@ -612,18 +612,6 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.pipelines.insert(pipeline_id, pipeline);
}
- // 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>,
- replace: bool) {
- self.pending_frames.push(FrameChange {
- old_pipeline_id: old_pipeline_id,
- new_pipeline_id: new_pipeline_id,
- document_ready: false,
- replace: replace,
- });
- }
-
// Get an iterator for the current frame tree. Specify self.root_frame_id to
// iterate the entire tree, or a specific frame id to iterate only that sub-tree.
fn current_frame_tree_iter(&self, frame_id_root: Option<FrameId>) -> FrameTreeIterator {
@@ -1158,7 +1146,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
let load_data = LoadData::new(failure_url, None, None);
self.new_pipeline(new_pipeline_id, parent_info, Some(pipeline_id), window_size, None, load_data, false);
- self.push_pending_frame(new_pipeline_id, Some(pipeline_id), false);
+ self.pending_frames.push(FrameChange {
+ old_pipeline_id: Some(pipeline_id),
+ new_pipeline_id: new_pipeline_id,
+ document_ready: false,
+ replace: false,
+ });
}
}
@@ -1183,7 +1176,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.new_pipeline(root_pipeline_id, None, None, Some(window_size), None,
LoadData::new(url.clone(), None, None), false);
self.handle_load_start_msg(root_pipeline_id);
- self.push_pending_frame(root_pipeline_id, None, false);
+ self.pending_frames.push(FrameChange {
+ old_pipeline_id: None,
+ new_pipeline_id: root_pipeline_id,
+ document_ready: false,
+ replace: false,
+ });
self.compositor_proxy.send(ToCompositorMsg::ChangePageUrl(root_pipeline_id, url));
}
@@ -1305,7 +1303,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
load_data,
is_private);
- self.push_pending_frame(load_info.new_pipeline_id, load_info.old_pipeline_id, load_info.replace);
+ self.pending_frames.push(FrameChange {
+ old_pipeline_id: load_info.old_pipeline_id,
+ new_pipeline_id: load_info.new_pipeline_id,
+ document_ready: false,
+ replace: load_info.replace,
+ });
}
fn handle_set_cursor_msg(&mut self, cursor: Cursor) {
@@ -1437,7 +1440,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
let window_size = self.pipelines.get(&source_id).and_then(|source| source.size);
let new_pipeline_id = PipelineId::new();
self.new_pipeline(new_pipeline_id, None, None, window_size, None, load_data, false);
- self.push_pending_frame(new_pipeline_id, Some(source_id), replace);
+ self.pending_frames.push(FrameChange {
+ old_pipeline_id: Some(source_id),
+ new_pipeline_id: new_pipeline_id,
+ document_ready: false,
+ replace: replace,
+ });
// Send message to ScriptThread that will suspend all timers
match self.pipelines.get(&source_id) {