mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Introduce GlobalScope::pipeline_id
This commit is contained in:
parent
c6ff767625
commit
27f100b1d4
21 changed files with 103 additions and 85 deletions
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue