diff options
Diffstat (limited to 'components/net_traits/image_cache_thread.rs')
-rw-r--r-- | components/net_traits/image_cache_thread.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/net_traits/image_cache_thread.rs b/components/net_traits/image_cache_thread.rs index 481a4f551ea..49bd1ea1c8f 100644 --- a/components/net_traits/image_cache_thread.rs +++ b/components/net_traits/image_cache_thread.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use FetchResponseMsg; use image::base::{Image, ImageMetadata}; use ipc_channel::ipc::{self, IpcSender}; use servo_url::ServoUrl; @@ -89,7 +90,7 @@ pub enum ImageCacheCommand { /// Instruct the cache to store this data as a newly-complete network request and continue /// decoding the result into pixel data - StoreDecodeImage(PendingImageId, Vec<u8>), + StoreDecodeImage(PendingImageId, FetchResponseMsg), /// Clients must wait for a response before shutting down the ResourceThread Exit(IpcSender<()>), @@ -151,9 +152,9 @@ impl ImageCacheThread { self.chan.send(msg).expect("Image cache thread is not available"); } - /// Decode the given image bytes and cache the result for the given pending ID. - pub fn store_complete_image_bytes(&self, id: PendingImageId, image_data: Vec<u8>) { - let msg = ImageCacheCommand::StoreDecodeImage(id, image_data); + /// Inform the image cache about a response for a pending request. + pub fn notify_pending_response(&self, id: PendingImageId, data: FetchResponseMsg) { + let msg = ImageCacheCommand::StoreDecodeImage(id, data); self.chan.send(msg).expect("Image cache thread is not available"); } |