mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce GlobalScope::process_event
This commit is contained in:
parent
cdf3ef05e7
commit
ca15dd5eea
3 changed files with 14 additions and 13 deletions
|
@ -18,8 +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 script_runtime::CommonScriptMsg;
|
||||
use script_thread::ScriptThread;
|
||||
use task_source::file_reading::FileReadingTaskSource;
|
||||
|
||||
/// A freely-copyable reference to a rooted global object.
|
||||
|
@ -65,15 +63,6 @@ impl<'a> GlobalRef<'a> {
|
|||
GlobalRef::Worker(ref worker) => worker.file_reading_task_source(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Process a single event as if it were the next event in the thread queue for
|
||||
/// this global.
|
||||
pub fn process_event(&self, msg: CommonScriptMsg) {
|
||||
match *self {
|
||||
GlobalRef::Window(_) => ScriptThread::process_event(msg),
|
||||
GlobalRef::Worker(ref worker) => worker.process_event(msg),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Reflectable for GlobalRef<'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue