aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/image_cache_thread.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/net/image_cache_thread.rs')
-rw-r--r--components/net/image_cache_thread.rs24
1 files changed, 6 insertions, 18 deletions
diff --git a/components/net/image_cache_thread.rs b/components/net/image_cache_thread.rs
index d9948514989..798c2ba0f61 100644
--- a/components/net/image_cache_thread.rs
+++ b/components/net/image_cache_thread.rs
@@ -396,8 +396,11 @@ impl ImageCache {
// TODO(#15501): look for opportunities to clean up cache if this send fails.
let _ = consumer.send(result);
}
- ImageCacheCommand::StoreDecodeImage(id, image_vector) => {
- self.store_decode_image(id, image_vector);
+ ImageCacheCommand::StoreDecodeImage(id, data) => {
+ self.handle_progress(ResourceLoadInfo {
+ action: data,
+ key: id
+ });
}
};
@@ -409,7 +412,7 @@ impl ImageCache {
match (msg.action, msg.key) {
(FetchResponseMsg::ProcessRequestBody, _) |
(FetchResponseMsg::ProcessRequestEOF, _) => return,
- (FetchResponseMsg::ProcessResponse(_), _) => {}
+ (FetchResponseMsg::ProcessResponse(_response), _) => {}
(FetchResponseMsg::ProcessResponseChunk(data), _) => {
let pending_load = self.pending_loads.get_by_key_mut(&msg.key).unwrap();
pending_load.bytes.extend_from_slice(&data);
@@ -581,21 +584,6 @@ impl ImageCache {
None => Err(ImageState::LoadError),
}
}
-
- fn store_decode_image(&mut self,
- id: PendingImageId,
- loaded_bytes: Vec<u8>) {
- let action = FetchResponseMsg::ProcessResponseChunk(loaded_bytes);
- self.handle_progress(ResourceLoadInfo {
- action: action,
- key: id,
- });
- let action = FetchResponseMsg::ProcessResponseEOF(Ok(()));
- self.handle_progress(ResourceLoadInfo {
- action: action,
- key: id,
- });
- }
}
/// Create a new image cache.