diff options
author | Josh Matthews <josh@joshmatthews.net> | 2015-02-19 10:00:02 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2015-03-03 16:25:40 -0500 |
commit | d9f04180a5d9146f4486ede6fabb9da638cccd41 (patch) | |
tree | e9cc19470b3d21bf8e012be90752f7999e1e3045 /components/script/page.rs | |
parent | 621150db1ca2d6ac9d4ba5d2709726dbc4139883 (diff) | |
download | servo-d9f04180a5d9146f4486ede6fabb9da638cccd41.tar.gz servo-d9f04180a5d9146f4486ede6fabb9da638cccd41.zip |
Split page load into separate network and parsing stages. Delay Page creation until the load is finished. Make session history traversal simply activate existing pipelines, rather than potentially loading them from the network.
Diffstat (limited to 'components/script/page.rs')
-rw-r--r-- | components/script/page.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/components/script/page.rs b/components/script/page.rs index c7ea2e44bec..3800b5b3950 100644 --- a/components/script/page.rs +++ b/components/script/page.rs @@ -68,11 +68,11 @@ pub struct Page { js_info: DOMRefCell<Option<JSPageInfo>>, - /// Cached copy of the most recent url loaded by the script + /// Cached copy of the most recent url loaded by the script, after all redirections. /// TODO(tkuehn): this currently does not follow any particular caching policy /// and simply caches pages forever (!). The bool indicates if reflow is required /// when reloading. - url: DOMRefCell<Option<(Url, bool)>>, + url: DOMRefCell<(Url, bool)>, next_subpage_id: Cell<SubpageId>, @@ -140,7 +140,8 @@ impl Page { storage_task: StorageTask, constellation_chan: ConstellationChan, js_context: Rc<Cx>, - devtools_chan: Option<DevtoolsControlChan>) -> Page { + devtools_chan: Option<DevtoolsControlChan>, + url: Url) -> Page { let js_info = JSPageInfo { dom_static: GlobalStaticData::new(), js_context: js_context, @@ -160,7 +161,7 @@ impl Page { layout_join_port: DOMRefCell::new(None), window_size: Cell::new(window_size), js_info: DOMRefCell::new(Some(js_info)), - url: DOMRefCell::new(None), + url: DOMRefCell::new((url, true)), next_subpage_id: Cell::new(SubpageId(0)), resize_event: Cell::new(None), fragment_name: DOMRefCell::new(None), @@ -292,11 +293,11 @@ impl Page { self.js_info.borrow() } - pub fn url<'a>(&'a self) -> Ref<'a, Option<(Url, bool)>> { + pub fn url<'a>(&'a self) -> Ref<'a, (Url, bool)> { self.url.borrow() } - pub fn mut_url<'a>(&'a self) -> RefMut<'a, Option<(Url, bool)>> { + pub fn mut_url<'a>(&'a self) -> RefMut<'a, (Url, bool)> { self.url.borrow_mut() } @@ -316,7 +317,7 @@ impl Page { } pub fn get_url(&self) -> Url { - self.url().as_ref().unwrap().0.clone() + self.url().0.clone() } // FIXME(cgaebel): join_layout is racey. What if the compositor triggers a |