mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Start switching net/ to use abstractions over channels to allow introducing non-channel communication in the future.
This commit is contained in:
parent
7fddf4aa13
commit
1644436557
13 changed files with 108 additions and 79 deletions
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use image::base::Image;
|
||||
use LoadConsumer::Channel;
|
||||
use {ControlMsg, LoadData, ProgressMsg, ResourceTask};
|
||||
use url::Url;
|
||||
|
||||
|
@ -84,7 +85,7 @@ impl ImageCacheTaskClient for ImageCacheTask {
|
|||
|
||||
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();
|
||||
resource_task.send(ControlMsg::Load(LoadData::new(url.clone()), Channel(response_chan))).unwrap();
|
||||
|
||||
let mut image_data = vec!();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue