mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Added support for synchronization along with an unit test for cancellation listener
This commit is contained in:
parent
10f5584f78
commit
c4cf72db6e
3 changed files with 59 additions and 0 deletions
|
@ -187,6 +187,9 @@ impl ResourceChannelManager {
|
|||
}
|
||||
self.resource_manager.cancel_load_map.remove(&res_id);
|
||||
}
|
||||
ControlMsg::Synchronize(sender) => {
|
||||
let _ = sender.send(());
|
||||
}
|
||||
ControlMsg::Exit => break,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,6 +234,8 @@ pub enum ControlMsg {
|
|||
GetCookiesForUrl(Url, IpcSender<Option<String>>, CookieSource),
|
||||
/// Cancel a network request corresponding to a given `ResourceId`
|
||||
Cancel(ResourceId),
|
||||
/// Synchronization message solely for knowing the state of the ResourceChannelManager loop
|
||||
Synchronize(IpcSender<()>),
|
||||
/// Break the load handler loop and exit
|
||||
Exit,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue