mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Allow wrapping worker runnables in cancellable runnables.
This commit is contained in:
parent
2cab846140
commit
0e4865ea1a
2 changed files with 17 additions and 1 deletions
|
@ -29,6 +29,7 @@ use net_traits::{LoadContext, ResourceThreads, load_whole_resource};
|
|||
use net_traits::{RequestSource, LoadOrigin, CustomResponseSender, IpcSend};
|
||||
use profile_traits::{mem, time};
|
||||
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort, maybe_take_panic_result};
|
||||
use script_thread::RunnableWrapper;
|
||||
use script_traits::ScriptMsg as ConstellationMsg;
|
||||
use script_traits::{MsDuration, TimerEvent, TimerEventId, TimerEventRequest, TimerSource};
|
||||
use std::cell::Cell;
|
||||
|
@ -268,6 +269,12 @@ impl WorkerGlobalScope {
|
|||
pub fn panic_chan(&self) -> &IpcSender<PanicMsg> {
|
||||
&self.panic_chan
|
||||
}
|
||||
|
||||
pub fn get_runnable_wrapper(&self) -> RunnableWrapper {
|
||||
RunnableWrapper {
|
||||
cancelled: self.closing.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl LoadOrigin for WorkerGlobalScope {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue