mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Properly implement TaskSource for NetworkingTaskSource
This commit is contained in:
parent
d99d26cf1f
commit
72cb856e31
15 changed files with 89 additions and 69 deletions
|
@ -42,6 +42,7 @@ use std::collections::hash_map::Entry;
|
|||
use std::ffi::CString;
|
||||
use std::panic;
|
||||
use task_source::file_reading::FileReadingTaskSource;
|
||||
use task_source::networking::NetworkingTaskSource;
|
||||
use time::{Timespec, get_time};
|
||||
use timers::{IsInterval, OneshotTimerCallback, OneshotTimerHandle};
|
||||
use timers::{OneshotTimers, TimerCallback};
|
||||
|
@ -325,12 +326,12 @@ impl GlobalScope {
|
|||
|
||||
/// `ScriptChan` to send messages to the networking task source of
|
||||
/// this of this global scope.
|
||||
pub fn networking_task_source(&self) -> Box<ScriptChan + Send> {
|
||||
pub fn networking_task_source(&self) -> NetworkingTaskSource {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.networking_task_source();
|
||||
}
|
||||
if let Some(worker) = self.downcast::<WorkerGlobalScope>() {
|
||||
return worker.script_chan();
|
||||
return worker.networking_task_source();
|
||||
}
|
||||
unreachable!();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue