diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2015-07-10 20:02:17 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2015-07-26 23:07:44 -0700 |
commit | 82b53d83ff6a85d337fdf0d322d0c5a0d334555b (patch) | |
tree | 7256bf28d766192e336410ef6b76fe8275df1d7a /components/script/script_task.rs | |
parent | 380de1ba821140b180ef137796e5c3097a953c11 (diff) | |
download | servo-82b53d83ff6a85d337fdf0d322d0c5a0d334555b.tar.gz servo-82b53d83ff6a85d337fdf0d322d0c5a0d334555b.zip |
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.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index a352414689d..f96edca83ac 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -53,12 +53,12 @@ use webdriver_handlers; use devtools_traits::{DevtoolsControlChan, DevtoolsControlPort, DevtoolsPageInfo}; use devtools_traits::{DevtoolsControlMsg, DevtoolScriptControlMsg}; use devtools_traits::{TimelineMarker, TimelineMarkerType, TracingMetadata}; -use script_traits::{CompositorEvent, MouseButton}; -use script_traits::CompositorEvent::{ResizeEvent, ClickEvent}; use script_traits::CompositorEvent::{MouseDownEvent, MouseUpEvent}; use script_traits::CompositorEvent::{MouseMoveEvent, KeyEvent}; -use script_traits::{NewLayoutInfo, OpaqueScriptLayoutChannel}; +use script_traits::CompositorEvent::{ResizeEvent, ClickEvent}; +use script_traits::{CompositorEvent, MouseButton}; use script_traits::{ConstellationControlMsg, ScriptControlChan}; +use script_traits::{NewLayoutInfo, OpaqueScriptLayoutChannel}; use script_traits::{ScriptState, ScriptTaskFactory}; use msg::compositor_msg::{LayerId, ScriptListener}; use msg::constellation_msg::{ConstellationChan, FocusType}; @@ -517,14 +517,18 @@ impl ScriptTask { } let (devtools_sender, devtools_receiver) = channel(); - let (image_cache_channel, image_cache_port) = channel(); + + // Ask the router to proxy IPC messages from the image cache task to us. + let (ipc_image_cache_channel, ipc_image_cache_port) = ipc::channel().unwrap(); + let image_cache_port = + ROUTER.route_ipc_receiver_to_new_mpsc_receiver(ipc_image_cache_port); ScriptTask { page: DOMRefCell::new(None), incomplete_loads: DOMRefCell::new(vec!()), image_cache_task: image_cache_task, - image_cache_channel: ImageCacheChan(image_cache_channel), + image_cache_channel: ImageCacheChan(ipc_image_cache_channel), image_cache_port: image_cache_port, resource_task: resource_task, |