script: Make the ImageCacheTask use IPC.

This necessitated getting rid of the boxed trait object that was being
be passed between the script task and the image cache task.
This commit is contained in:
Patrick Walton 2015-07-10 20:02:17 -07:00
parent 380de1ba82
commit 82b53d83ff
11 changed files with 102 additions and 61 deletions

View file

@ -15,7 +15,7 @@ use euclid::{Rect, Size2D};
use gfx::display_list::OpaqueNode;
use gfx::font_cache_task::FontCacheTask;
use gfx::font_context::FontContext;
use ipc_channel::ipc::IpcSender;
use ipc_channel::ipc::{self, IpcSender};
use msg::constellation_msg::ConstellationChan;
use net_traits::image::base::Image;
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState};
@ -192,7 +192,7 @@ impl<'a> LayoutContext<'a> {
(ImageState::LoadError, _) => None,
// Not loaded, test mode - load the image synchronously
(_, true) => {
let (sync_tx, sync_rx) = channel();
let (sync_tx, sync_rx) = ipc::channel().unwrap();
self.shared.image_cache_task.request_image(url,
ImageCacheChan(sync_tx),
None);