diff --git a/servo/components/compositing/constellation.rs b/servo/components/compositing/constellation.rs index 7485f21e5bff..9f0e98e2e309 100644 --- a/servo/components/compositing/constellation.rs +++ b/servo/components/compositing/constellation.rs @@ -20,9 +20,8 @@ use msg::constellation_msg::{IFrameSandboxState, MozBrowserEvent, NavigationDire use msg::constellation_msg::{Key, KeyState, KeyModifiers, LoadData}; use msg::constellation_msg::{SubpageId, WindowSizeData}; use msg::constellation_msg::{self, ConstellationChan, Failure}; -use net::image_cache_task::ImageCacheTaskClient; use net_traits::{self, ResourceTask}; -use net_traits::image_cache_task::ImageCacheTask; +use net_traits::image_cache_task::{ImageCacheTask, ImageCacheTaskClient}; use net_traits::storage_task::{StorageTask, StorageTaskMsg}; use profile::mem; use profile::time; diff --git a/servo/components/net/image_cache_task.rs b/servo/components/net/image_cache_task.rs index 5897ee50fb2b..a97d29b8d660 100644 --- a/servo/components/net/image_cache_task.rs +++ b/servo/components/net/image_cache_task.rs @@ -395,18 +395,6 @@ impl ImageCache { } } -pub trait ImageCacheTaskClient { - fn exit(&self); -} - -impl ImageCacheTaskClient for ImageCacheTask { - fn exit(&self) { - let (response_chan, response_port) = channel(); - self.send(Msg::Exit(response_chan)); - response_port.recv().unwrap(); - } -} - pub fn spawn_listener(f: F) -> Sender where F: FnOnce(Receiver) + Send + 'static, A: Send + 'static diff --git a/servo/components/net_traits/image_cache_task.rs b/servo/components/net_traits/image_cache_task.rs index 2ce4d78dbf41..3dfbed3fde69 100644 --- a/servo/components/net_traits/image_cache_task.rs +++ b/servo/components/net_traits/image_cache_task.rs @@ -70,6 +70,18 @@ impl ImageCacheTask { } } +pub trait ImageCacheTaskClient { + fn exit(&self); +} + +impl ImageCacheTaskClient for ImageCacheTask { + fn exit(&self) { + let (response_chan, response_port) = channel(); + self.send(Msg::Exit(response_chan)); + response_port.recv().unwrap(); + } +} + pub fn load_image_data(url: Url, resource_task: ResourceTask, placeholder: &[u8]) -> Result, ()> { let (response_chan, response_port) = channel(); resource_task.send(ControlMsg::Load(LoadData::new(url.clone(), response_chan))).unwrap(); diff --git a/servo/tests/unit/net/image_cache_task.rs b/servo/tests/unit/net/image_cache_task.rs index a57b0361e6c7..c384411fb99f 100644 --- a/servo/tests/unit/net/image_cache_task.rs +++ b/servo/tests/unit/net/image_cache_task.rs @@ -8,7 +8,7 @@ use net_traits::image_cache_task::Msg::*; use net::resource_task::start_sending; use net_traits::{ControlMsg, Metadata, ProgressMsg, ResourceTask}; -use net_traits::image_cache_task::{ImageCacheTask, ImageResponseMsg, Msg}; +use net_traits::image_cache_task::{ImageCacheTask, ImageCacheTaskClient, ImageResponseMsg, Msg}; use net_traits::ProgressMsg::{Payload, Done}; use profile::time; use std::sync::mpsc::{Sender, channel, Receiver};