aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r--components/layout/layout_task.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index a6c92306273..7d0df0fc5e6 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -68,7 +68,6 @@ use std::mem::transmute;
use std::ops::{Deref, DerefMut};
use std::sync::mpsc::{channel, Sender, Receiver, Select};
use std::sync::{Arc, Mutex, MutexGuard};
-use std::thread;
use style::computed_values::{filter, mix_blend_mode};
use style::media_queries::{MediaType, MediaQueryList, Device};
use style::selector_matching::Stylist;
@@ -327,16 +326,15 @@ impl LayoutTask {
// Create the channel on which new animations can be sent.
let (new_animations_sender, new_animations_receiver) = channel();
- let (image_cache_sender, image_cache_receiver) = channel();
let (canvas_layers_sender, canvas_layers_receiver) = channel();
- // Start a thread to proxy IPC messages from the layout thread to us.
- let (pipeline_sender, pipeline_receiver) = channel();
- thread::spawn(move || {
- while let Ok(message) = pipeline_port.recv() {
- pipeline_sender.send(message).unwrap()
- }
- });
+ // Proxy IPC messages from the pipeline to the layout thread.
+ let pipeline_receiver = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(pipeline_port);
+
+ // Ask the router to proxy IPC messages from the image cache task to the layout thread.
+ let (ipc_image_cache_sender, ipc_image_cache_receiver) = ipc::channel().unwrap();
+ let image_cache_receiver =
+ ROUTER.route_ipc_receiver_to_new_mpsc_receiver(ipc_image_cache_receiver);
LayoutTask {
id: id,
@@ -354,7 +352,7 @@ impl LayoutTask {
font_cache_task: font_cache_task,
first_reflow: Cell::new(true),
image_cache_receiver: image_cache_receiver,
- image_cache_sender: ImageCacheChan(image_cache_sender),
+ image_cache_sender: ImageCacheChan(ipc_image_cache_sender),
canvas_layers_receiver: canvas_layers_receiver,
canvas_layers_sender: canvas_layers_sender,
rw_data: Arc::new(Mutex::new(