Make image cache per-document rather than global

This commit is contained in:
Fernando Jiménez Moreno 2017-03-16 11:08:09 +01:00
parent 9eb6bb78b0
commit 72d7ee613b
25 changed files with 448 additions and 649 deletions

View file

@ -338,12 +338,12 @@ impl<'a> From<&'a WebGLContextAttributes> for GLContextAttributes {
pub mod utils {
use dom::window::Window;
use net_traits::image_cache_thread::{ImageResponse, UsePlaceholder, ImageOrMetadataAvailable};
use net_traits::image_cache_thread::CanRequestImages;
use net_traits::image_cache::{ImageResponse, UsePlaceholder, ImageOrMetadataAvailable};
use net_traits::image_cache::CanRequestImages;
use servo_url::ServoUrl;
pub fn request_image_from_cache(window: &Window, url: ServoUrl) -> ImageResponse {
let image_cache = window.image_cache_thread();
let image_cache = window.image_cache();
let response =
image_cache.find_image_or_metadata(url.into(),
UsePlaceholder::No,