Implement file reading task source

And remove superfluous FileReaderEvent enum
This commit is contained in:
Keith Yeung 2016-06-06 16:57:15 -04:00 committed by Josh Matthews
parent 2aef518ce6
commit aa5f34fcd9
6 changed files with 96 additions and 62 deletions

View file

@ -39,6 +39,7 @@ use std::rc::Rc;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::Receiver;
use task_source::file_reading::FileReadingTaskSource;
use timers::{IsInterval, OneshotTimerCallback, OneshotTimerHandle, OneshotTimers, TimerCallback};
use url::Url;
@ -460,6 +461,10 @@ impl WorkerGlobalScope {
}
}
pub fn file_reading_task_source(&self) -> FileReadingTaskSource {
FileReadingTaskSource(self.script_chan())
}
pub fn pipeline(&self) -> PipelineId {
let dedicated = self.downcast::<DedicatedWorkerGlobalScope>();
let service_worker = self.downcast::<ServiceWorkerGlobalScope>();