mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
use remote-event task source in EventSource
This commit is contained in:
parent
f66c9b6160
commit
baef63becd
7 changed files with 81 additions and 8 deletions
|
@ -56,6 +56,7 @@ use task_source::TaskSourceName;
|
|||
use task_source::file_reading::FileReadingTaskSource;
|
||||
use task_source::networking::NetworkingTaskSource;
|
||||
use task_source::performance_timeline::PerformanceTimelineTaskSource;
|
||||
use task_source::remote_event::RemoteEventTaskSource;
|
||||
use time::{Timespec, get_time};
|
||||
use timers::{IsInterval, OneshotTimerCallback, OneshotTimerHandle};
|
||||
use timers::{OneshotTimers, TimerCallback};
|
||||
|
@ -390,7 +391,7 @@ impl GlobalScope {
|
|||
}
|
||||
|
||||
/// `ScriptChan` to send messages to the networking task source of
|
||||
/// this of this global scope.
|
||||
/// this global scope.
|
||||
pub fn networking_task_source(&self) -> NetworkingTaskSource {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.networking_task_source();
|
||||
|
@ -401,6 +402,18 @@ impl GlobalScope {
|
|||
unreachable!();
|
||||
}
|
||||
|
||||
/// `ScriptChan` to send messages to the remote-event task source of
|
||||
/// this global scope.
|
||||
pub fn remote_event_task_source(&self) -> RemoteEventTaskSource {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.remote_event_task_source();
|
||||
}
|
||||
if let Some(worker) = self.downcast::<WorkerGlobalScope>() {
|
||||
return worker.remote_event_task_source();
|
||||
}
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
/// Evaluate JS code on this global scope.
|
||||
pub fn evaluate_js_on_global_with_result(
|
||||
&self, code: &str, rval: MutableHandleValue) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue