Remove compositor dependency on net crate.

Move the ImageCacheTaskClient trait and impl to net_traits. Fixes #5551.
This commit is contained in:
Aneesh Agrawal 2015-04-07 01:20:38 -04:00
parent c9a413cb6e
commit a1d7456307
3 changed files with 13 additions and 14 deletions

View file

@ -70,6 +70,18 @@ impl ImageCacheTask {
}
}
pub trait ImageCacheTaskClient {
fn exit(&self);
}
impl ImageCacheTaskClient for ImageCacheTask {
fn exit(&self) {
let (response_chan, response_port) = channel();
self.send(Msg::Exit(response_chan));
response_port.recv().unwrap();
}
}
pub fn load_image_data(url: Url, resource_task: ResourceTask, placeholder: &[u8]) -> Result<Vec<u8>, ()> {
let (response_chan, response_port) = channel();
resource_task.send(ControlMsg::Load(LoadData::new(url.clone(), response_chan))).unwrap();