aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/context.rs')
-rw-r--r--components/layout/context.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/components/layout/context.rs b/components/layout/context.rs
index e2ffeb1cbd9..72be2555720 100644
--- a/components/layout/context.rs
+++ b/components/layout/context.rs
@@ -9,8 +9,8 @@ use gfx::display_list::{WebRenderImageInfo, OpaqueNode};
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext;
use heapsize::HeapSizeOf;
-use net_traits::image_cache_thread::{ImageCacheThread, ImageState, CanRequestImages};
-use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder};
+use net_traits::image_cache::{CanRequestImages, ImageCache, ImageState};
+use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
use opaque_node::OpaqueNodeMethods;
use parking_lot::RwLock;
use script_layout_interface::{PendingImage, PendingImageState};
@@ -79,8 +79,8 @@ pub struct LayoutContext<'a> {
/// Bits shared by the layout and style system.
pub style_context: SharedStyleContext<'a>,
- /// The shared image cache thread.
- pub image_cache_thread: Mutex<ImageCacheThread>,
+ /// Reference to the script thread image cache.
+ pub image_cache: Arc<ImageCache>,
/// Interface to the font cache thread.
pub font_cache_thread: Mutex<FontCacheThread>,
@@ -126,10 +126,9 @@ impl<'a> LayoutContext<'a> {
};
// See if the image is already available
- let result = self.image_cache_thread.lock().unwrap()
- .find_image_or_metadata(url.clone(),
- use_placeholder,
- can_request);
+ let result = self.image_cache.find_image_or_metadata(url.clone(),
+ use_placeholder,
+ can_request);
match result {
Ok(image_or_metadata) => Some(image_or_metadata),
// Image failed to load, so just return nothing