servo: Merge #10594 - Remove containing_page_pipeline_id (from sliz1:10576); r=Ms2ger
authorStephen (Ziyun) Li <stephen.liziyun@gmail.com>
Thu, 14 Apr 2016 13:40:41 +0500
changeset 338516 2e3d70a8bda739692b8f25587133a6986a0c0c58
parent 338515 ad3b87c88fd7e0517e1f4f8b8e57d1721e11bd84
child 338517 244dbd6196d4099e1d85eecba38e26a6523222aa
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
servo: Merge #10594 - Remove containing_page_pipeline_id (from sliz1:10576); r=Ms2ger Fixes https://github.com/servo/servo/issues/10569 Source-Repo: https://github.com/servo/servo Source-Revision: 11f4d3f35609552feded6de56cc95aaf73ccc699
servo/components/script/dom/htmliframeelement.rs
--- a/servo/components/script/dom/htmliframeelement.rs
+++ b/servo/components/script/dom/htmliframeelement.rs
@@ -61,17 +61,16 @@ enum SandboxAllowance {
     AllowPopups = 0x20
 }
 
 #[dom_struct]
 pub struct HTMLIFrameElement {
     htmlelement: HTMLElement,
     pipeline_id: Cell<Option<PipelineId>>,
     subpage_id: Cell<Option<SubpageId>>,
-    containing_page_pipeline_id: Cell<Option<PipelineId>>,
     sandbox: Cell<Option<u8>>,
     load_blocker: DOMRefCell<Option<LoadBlocker>>,
 }
 
 impl HTMLIFrameElement {
     pub fn is_sandboxed(&self) -> bool {
         self.sandbox.get().is_some()
     }
@@ -121,18 +120,16 @@ impl HTMLIFrameElement {
         }
 
         let window = window_from_node(self);
         let window = window.r();
         let (new_subpage_id, old_subpage_id) = self.generate_new_subpage_id();
         let new_pipeline_id = self.pipeline_id.get().unwrap();
         let private_iframe = self.privatebrowsing();
 
-        self.containing_page_pipeline_id.set(Some(window.pipeline()));
-
         let ConstellationChan(ref chan) = window.constellation_chan();
         let load_info = IFrameLoadInfo {
             url: url,
             containing_pipeline_id: window.pipeline(),
             new_subpage_id: new_subpage_id,
             old_subpage_id: old_subpage_id,
             new_pipeline_id: new_pipeline_id,
             sandbox: sandboxed,
@@ -187,36 +184,30 @@ impl HTMLIFrameElement {
 
     fn new_inherited(localName: Atom,
                      prefix: Option<DOMString>,
                      document: &Document) -> HTMLIFrameElement {
         HTMLIFrameElement {
             htmlelement: HTMLElement::new_inherited(localName, prefix, document),
             pipeline_id: Cell::new(None),
             subpage_id: Cell::new(None),
-            containing_page_pipeline_id: Cell::new(None),
             sandbox: Cell::new(None),
             load_blocker: DOMRefCell::new(None),
         }
     }
 
     #[allow(unrooted_must_root)]
     pub fn new(localName: Atom,
                prefix: Option<DOMString>,
                document: &Document) -> Root<HTMLIFrameElement> {
         let element = HTMLIFrameElement::new_inherited(localName, prefix, document);
         Node::reflect_node(box element, document, HTMLIFrameElementBinding::Wrap)
     }
 
     #[inline]
-    pub fn containing_page_pipeline_id(&self) -> Option<PipelineId> {
-        self.containing_page_pipeline_id.get()
-    }
-
-    #[inline]
     pub fn pipeline_id(&self) -> Option<PipelineId> {
         self.pipeline_id.get()
     }
 
     #[inline]
     pub fn subpage_id(&self) -> Option<SubpageId> {
         self.subpage_id.get()
     }
@@ -368,17 +359,17 @@ impl MozBrowserEventDetailBuilder for HT
 }
 
 pub fn Navigate(iframe: &HTMLIFrameElement, direction: NavigationDirection) -> ErrorResult {
     if iframe.Mozbrowser() {
         if iframe.upcast::<Node>().is_in_doc() {
             let window = window_from_node(iframe);
             let window = window.r();
 
-            let pipeline_info = Some((iframe.containing_page_pipeline_id().unwrap(),
+            let pipeline_info = Some((window.pipeline(),
                                       iframe.subpage_id().unwrap()));
             let ConstellationChan(ref chan) = window.constellation_chan();
             let msg = ConstellationMsg::Navigate(pipeline_info, direction);
             chan.send(msg).unwrap();
         }
 
         Ok(())
     } else {