mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add cancellability to file manager load and related refactoring
This commit is contained in:
parent
7807895d58
commit
17ae38a318
12 changed files with 137 additions and 189 deletions
|
@ -321,17 +321,14 @@ pub trait IpcSend<T> where T: serde::Serialize + serde::Deserialize {
|
|||
pub struct ResourceThreads {
|
||||
core_thread: CoreResourceThread,
|
||||
storage_thread: IpcSender<StorageThreadMsg>,
|
||||
filemanager_thread: IpcSender<FileManagerThreadMsg>,
|
||||
}
|
||||
|
||||
impl ResourceThreads {
|
||||
pub fn new(c: CoreResourceThread,
|
||||
s: IpcSender<StorageThreadMsg>,
|
||||
f: IpcSender<FileManagerThreadMsg>) -> ResourceThreads {
|
||||
s: IpcSender<StorageThreadMsg>) -> ResourceThreads {
|
||||
ResourceThreads {
|
||||
core_thread: c,
|
||||
storage_thread: s,
|
||||
filemanager_thread: f,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -356,16 +353,6 @@ impl IpcSend<StorageThreadMsg> for ResourceThreads {
|
|||
}
|
||||
}
|
||||
|
||||
impl IpcSend<FileManagerThreadMsg> for ResourceThreads {
|
||||
fn send(&self, msg: FileManagerThreadMsg) -> IpcSendResult {
|
||||
self.filemanager_thread.send(msg)
|
||||
}
|
||||
|
||||
fn sender(&self) -> IpcSender<FileManagerThreadMsg> {
|
||||
self.filemanager_thread.clone()
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore the sub-fields
|
||||
impl HeapSizeOf for ResourceThreads {
|
||||
fn heap_size_of_children(&self) -> usize { 0 }
|
||||
|
@ -431,6 +418,8 @@ pub enum CoreResourceMsg {
|
|||
Synchronize(IpcSender<()>),
|
||||
/// Send the network sender in constellation to CoreResourceThread
|
||||
NetworkMediator(IpcSender<CustomResponseMediator>),
|
||||
/// Message forwarded to file manager's handler
|
||||
ToFileManager(FileManagerThreadMsg),
|
||||
/// Break the load handler loop, send a reply when done cleaning up local resources
|
||||
// and exit
|
||||
Exit(IpcSender<()>),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue