Introduce GlobalScope::file_reading_task_source

This commit is contained in:
Anthony Ramine 2016-10-05 09:52:30 +02:00
parent 0a11c48e89
commit e7a1149984
3 changed files with 17 additions and 13 deletions

View file

@ -18,7 +18,6 @@ use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
use js::glue::{IsWrapper, UnwrapObject};
use js::jsapi::{CurrentGlobalOrNull, GetGlobalForObjectCrossCompartment};
use js::jsapi::{JSContext, JSObject, JS_GetClass};
use task_source::file_reading::FileReadingTaskSource;
/// A freely-copyable reference to a rooted global object.
#[derive(Copy, Clone)]
@ -54,15 +53,6 @@ impl<'a> GlobalRef<'a> {
GlobalRef::Worker(ref worker) => worker.get_cx(),
}
}
/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
pub fn file_reading_task_source(&self) -> FileReadingTaskSource {
match *self {
GlobalRef::Window(ref window) => window.file_reading_task_source(),
GlobalRef::Worker(ref worker) => worker.file_reading_task_source(),
}
}
}
impl<'a> Reflectable for GlobalRef<'a> {