Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse srcset algo #10829

Closed
wants to merge 10 commits into from

Addressed reviews

  • Loading branch information
srm09 committed Apr 23, 2016
commit de736fb75100bb591e70c982e6ff9c5103a33874
@@ -395,7 +395,7 @@ impl ImageCache {
consumer.send(result).unwrap();
}
ImageCacheCommand::StoreDecodeImage(url, image_vector) => {
let result = self.store_decode_image(url, image_vector);
self.store_decode_image(url, image_vector);
}
};

@@ -595,11 +595,10 @@ impl ImageCache {
fn store_decode_image(&mut self,
ref_url: Url,
loaded_bytes: Vec<u8>) {
let (cache_result, load_key, mut pending_load) = self.pending_loads.get_cached(Arc::new(ref_url.clone()));

let progress_sender = self.progress_sender.clone();
let action: ResponseAction = ResponseAction::DataAvailable(loaded_bytes);
progress_sender.send(ResourceLoadInfo {
let (cache_result, load_key, pending_load) = self.pending_loads.get_cached(Arc::new(ref_url));
assert!(cache_result == CacheResult::Miss);
let action: ResponseAction = ResponseAction::ResponseComplete(Ok(()));
self.progress_sender.send(ResourceLoadInfo {
action: action,
key: load_key,
});
@@ -161,9 +161,8 @@ impl ImageCacheThread {
receiver.recv().unwrap()
}

/// Get the vector of bytess ....
/// See ImageCacheCommand::StoreDecodeImage.
pub fn find_store_decode_image(&self,
/// Decode the given image bytes and cache the result for the given URL.
pub fn store_complete_image_bytes(&self,
url: Url,
image_data: Vec<u8>) {
let msg = ImageCacheCommand::StoreDecodeImage(url, image_data);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.