mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce GlobalScope::networking_task_source
This commit is contained in:
parent
a7305b7fc4
commit
1fd470889d
5 changed files with 19 additions and 16 deletions
|
@ -270,6 +270,18 @@ impl GlobalScope {
|
|||
}
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
/// `ScriptChan` to send messages to the networking task source of
|
||||
/// this of this global scope.
|
||||
pub fn networking_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.networking_task_source();
|
||||
}
|
||||
if let Some(worker) = self.downcast::<WorkerGlobalScope>() {
|
||||
return worker.script_chan();
|
||||
}
|
||||
unreachable!();
|
||||
}
|
||||
}
|
||||
|
||||
fn timestamp_in_ms(time: Timespec) -> u64 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue