Introduce GlobalScope::pipeline_id

This commit is contained in:
Anthony Ramine 2016-10-01 17:24:54 +02:00
parent c6ff767625
commit 27f100b1d4
21 changed files with 103 additions and 85 deletions

View file

@ -39,19 +39,21 @@ impl History {
impl History {
fn traverse_history(&self, direction: TraversalDirection) {
let pipeline = self.window.pipeline_id();
let global_scope = self.window.upcast::<GlobalScope>();
let pipeline = global_scope.pipeline_id();
let msg = ConstellationMsg::TraverseHistory(Some(pipeline), direction);
let _ = self.window.upcast::<GlobalScope>().constellation_chan().send(msg);
let _ = global_scope.constellation_chan().send(msg);
}
}
impl HistoryMethods for History {
// https://html.spec.whatwg.org/multipage/#dom-history-length
fn Length(&self) -> u32 {
let pipeline = self.window.pipeline_id();
let global_scope = self.window.upcast::<GlobalScope>();
let pipeline = global_scope.pipeline_id();
let (sender, recv) = ipc::channel().expect("Failed to create channel to send jsh length.");
let msg = ConstellationMsg::JointSessionHistoryLength(pipeline, sender);
let _ = self.window.upcast::<GlobalScope>().constellation_chan().send(msg);
let _ = global_scope.constellation_chan().send(msg);
recv.recv().unwrap()
}