mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Implement trait-based ResourceThreads and clean up related naming issues
Changes include: - Introduce an IpcSend trait to abstract over a collection of IpcSenders - Implement ResourceThreads collection to abstract the resource-related sub threads across the component - Rename original ResourceThread and ControlMsg into an unifed CoreResource__ to accommodate above changes and avoid confusions
This commit is contained in:
parent
051a749e0d
commit
a51db4cfa8
22 changed files with 213 additions and 179 deletions
|
@ -18,7 +18,7 @@ pub struct FileManager {
|
|||
}
|
||||
|
||||
impl FileManager {
|
||||
pub fn new(recv: IpcReceiver<FileManagerThreadMsg>) -> FileManager {
|
||||
fn new(recv: IpcReceiver<FileManagerThreadMsg>) -> FileManager {
|
||||
FileManager {
|
||||
receiver: recv,
|
||||
idmap: RefCell::new(HashMap::new()),
|
||||
|
@ -36,7 +36,7 @@ impl FileManager {
|
|||
}
|
||||
|
||||
/// Start the file manager event loop
|
||||
pub fn start(&mut self) {
|
||||
fn start(&mut self) {
|
||||
loop {
|
||||
match self.receiver.recv().unwrap() {
|
||||
FileManagerThreadMsg::SelectFile(sender) => self.select_file(sender),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue