always call new_pipeline() before add_pending_changes()

This commit is contained in:
Paul Rouget 2017-07-13 09:50:59 +02:00
parent f85778884f
commit 9ba1d32f9d

View file

@ -1576,22 +1576,21 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
}; };
// Create the new pipeline, attached to the parent and push to pending changes // Create the new pipeline, attached to the parent and push to pending changes
self.add_pending_change(SessionHistoryChange {
top_level_browsing_context_id: load_info.info.top_level_browsing_context_id,
browsing_context_id: load_info.info.browsing_context_id,
new_pipeline_id: load_info.info.new_pipeline_id,
load_data: load_data.clone(),
replace_instant: replace_instant,
});
self.new_pipeline(load_info.info.new_pipeline_id, self.new_pipeline(load_info.info.new_pipeline_id,
load_info.info.browsing_context_id, load_info.info.browsing_context_id,
load_info.info.top_level_browsing_context_id, load_info.info.top_level_browsing_context_id,
Some((load_info.info.parent_pipeline_id, load_info.info.frame_type)), Some((load_info.info.parent_pipeline_id, load_info.info.frame_type)),
window_size, window_size,
load_data, load_data.clone(),
load_info.sandbox, load_info.sandbox,
is_private); is_private);
self.add_pending_change(SessionHistoryChange {
top_level_browsing_context_id: load_info.info.top_level_browsing_context_id,
browsing_context_id: load_info.info.browsing_context_id,
new_pipeline_id: load_info.info.new_pipeline_id,
load_data: load_data,
replace_instant: replace_instant,
});
} }
fn handle_script_new_iframe(&mut self, fn handle_script_new_iframe(&mut self,
@ -1792,21 +1791,21 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
let new_pipeline_id = PipelineId::new(); let new_pipeline_id = PipelineId::new();
let sandbox = IFrameSandboxState::IFrameUnsandboxed; let sandbox = IFrameSandboxState::IFrameUnsandboxed;
let replace_instant = if replace { Some(timestamp) } else { None }; let replace_instant = if replace { Some(timestamp) } else { None };
self.add_pending_change(SessionHistoryChange {
top_level_browsing_context_id: top_level_id,
browsing_context_id: browsing_context_id,
new_pipeline_id: new_pipeline_id,
load_data: load_data.clone(),
replace_instant: replace_instant,
});
self.new_pipeline(new_pipeline_id, self.new_pipeline(new_pipeline_id,
browsing_context_id, browsing_context_id,
top_level_id, top_level_id,
None, None,
window_size, window_size,
load_data, load_data.clone(),
sandbox, sandbox,
false); false);
self.add_pending_change(SessionHistoryChange {
top_level_browsing_context_id: top_level_id,
browsing_context_id: browsing_context_id,
new_pipeline_id: new_pipeline_id,
load_data: load_data,
replace_instant: replace_instant,
});
Some(new_pipeline_id) Some(new_pipeline_id)
} }
} }