diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2015-03-11 13:41:55 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2015-03-11 13:41:55 +1000 |
commit | ec91fa2cfd2a4f610c5a2f20ad1e57ba058078cb (patch) | |
tree | 4e11a5eaecc03afa8207c6223c66cca0e4b2330c | |
parent | e581648c75a55a5939a16f4089295154e38dbc23 (diff) | |
download | servo-ec91fa2cfd2a4f610c5a2f20ad1e57ba058078cb.tar.gz servo-ec91fa2cfd2a4f610c5a2f20ad1e57ba058078cb.zip |
Remove now unused id field for frame tree.
-rw-r--r-- | components/compositing/compositor_task.rs | 2 | ||||
-rw-r--r-- | components/compositing/constellation.rs | 34 |
2 files changed, 6 insertions, 30 deletions
diff --git a/components/compositing/compositor_task.rs b/components/compositing/compositor_task.rs index 172716be5bf..7edc6542202 100644 --- a/components/compositing/compositor_task.rs +++ b/components/compositing/compositor_task.rs @@ -5,7 +5,7 @@ //! Communication with the compositor task. pub use windowing; -pub use constellation::{FrameId, SendableFrameTree}; +pub use constellation::SendableFrameTree; use compositor; use headless; diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 3def1896346..abebea1d215 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -76,9 +76,6 @@ pub struct Constellation<LTF, STF> { /// The next free ID to assign to a pipeline. next_pipeline_id: PipelineId, - /// The next free ID to assign to a frame. - next_frame_id: FrameId, - /// Navigation operations that are in progress. pending_frames: Vec<FrameChange>, @@ -90,14 +87,8 @@ pub struct Constellation<LTF, STF> { pub window_size: WindowSizeData, } -/// A unique ID used to identify a frame. -#[derive(Copy)] -pub struct FrameId(u32); - /// One frame in the hierarchy. struct FrameTree { - /// The ID of this frame. - pub id: FrameId, /// The pipeline for this frame. pub pipeline: RefCell<Rc<Pipeline>>, /// The parent frame's pipeline. @@ -109,10 +100,9 @@ struct FrameTree { } impl FrameTree { - fn new(id: FrameId, pipeline: Rc<Pipeline>, parent_pipeline: Option<Rc<Pipeline>>) + fn new(pipeline: Rc<Pipeline>, parent_pipeline: Option<Rc<Pipeline>>) -> FrameTree { FrameTree { - id: id, pipeline: RefCell::new(pipeline.clone()), parent: RefCell::new(parent_pipeline), children: RefCell::new(vec!()), @@ -364,7 +354,6 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { pipelines: HashMap::new(), navigation_context: NavigationContext::new(), next_pipeline_id: PipelineId(0), - next_frame_id: FrameId(0), pending_frames: vec!(), pending_sizes: HashMap::new(), time_profiler_chan: time_profiler_chan, @@ -419,14 +408,6 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { id } - /// Helper function for getting a unique frame ID. - fn get_next_frame_id(&mut self) -> FrameId { - let id = self.next_frame_id; - let FrameId(ref mut i) = self.next_frame_id; - *i += 1; - id - } - /// Convenience function for getting the currently active frame tree. /// The currently active frame tree should always be the current painter fn current_frame<'a>(&'a self) -> &'a Option<Rc<FrameTree>> { @@ -567,12 +548,11 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { debug!("creating replacement pipeline for about:failure"); let new_id = self.get_next_pipeline_id(); - let new_frame_id = self.get_next_frame_id(); let pipeline = self.new_pipeline(new_id, parent, None, LoadData::new(Url::parse("about:failure").unwrap())); self.browse(Some(pipeline_id), - Rc::new(FrameTree::new(new_frame_id, pipeline.clone(), None)), + Rc::new(FrameTree::new(pipeline.clone(), None)), NavigationType::Load); self.pipelines.insert(new_id, pipeline); @@ -594,10 +574,9 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { fn handle_init_load(&mut self, url: Url) { let next_pipeline_id = self.get_next_pipeline_id(); - let next_frame_id = self.get_next_frame_id(); let pipeline = self.new_pipeline(next_pipeline_id, None, None, LoadData::new(url)); self.browse(None, - Rc::new(FrameTree::new(next_frame_id, pipeline.clone(), None)), + Rc::new(FrameTree::new(pipeline.clone(), None)), NavigationType::Load); self.pipelines.insert(pipeline.id, pipeline); } @@ -729,8 +708,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { self.update_child_pipeline(frame_tree.clone(), new_pipeline, old_subpage_id), None => { let child_tree = Rc::new( - FrameTree::new(self.get_next_frame_id(), - new_pipeline, + FrameTree::new(new_pipeline, Some(frame_tree.pipeline.borrow().clone()))); frame_tree.add_child(ChildFrameTree::new(child_tree, new_rect)); } @@ -826,11 +804,9 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> { let parent = source_frame.parent.clone(); let parent_id = source_frame.pipeline.borrow().parent; let next_pipeline_id = self.get_next_pipeline_id(); - let next_frame_id = self.get_next_frame_id(); let pipeline = self.new_pipeline(next_pipeline_id, parent_id, None, load_data); self.browse(Some(source_id), - Rc::new(FrameTree::new(next_frame_id, - pipeline.clone(), + Rc::new(FrameTree::new(pipeline.clone(), parent.borrow().clone())), NavigationType::Load); // Send message to ScriptTask that will suspend all timers |