mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Introduce GlobalScope::get_url
This commit is contained in:
parent
092504b4e3
commit
f38159b7d3
10 changed files with 39 additions and 39 deletions
|
@ -179,6 +179,17 @@ impl GlobalScope {
|
|||
}
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
/// Get the URL for this global scope.
|
||||
pub fn get_url(&self) -> Url {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.get_url();
|
||||
}
|
||||
if let Some(worker) = self.downcast::<WorkerGlobalScope>() {
|
||||
return worker.get_url().clone();
|
||||
}
|
||||
unreachable!();
|
||||
}
|
||||
}
|
||||
|
||||
fn timestamp_in_ms(time: Timespec) -> u64 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue