mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Introduce GlobalScope::as_window
This commit is contained in:
parent
2f54022761
commit
766010379e
22 changed files with 30 additions and 43 deletions
|
@ -68,15 +68,6 @@ impl<'a> GlobalRef<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Extract a `Window`, causing thread failure if the global object is not
|
||||
/// a `Window`.
|
||||
pub fn as_window(&self) -> &window::Window {
|
||||
match *self {
|
||||
GlobalRef::Window(window) => window,
|
||||
GlobalRef::Worker(_) => panic!("expected a Window scope"),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `ResourceThreads` for this global scope.
|
||||
pub fn resource_threads(&self) -> ResourceThreads {
|
||||
match *self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue