From 41ac66112aa36497dc0761620be5f5ace7f610ed Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 12 Aug 2015 15:34:41 +0200 Subject: [PATCH] Store a Sender in Window. --- components/script/dom/window.rs | 10 +++++----- components/script/script_task.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 7788fe05dd7..f2c92b79ed9 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -36,7 +36,7 @@ use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleRe use page::Page; use script_task::{TimerSource, ScriptChan, ScriptPort, NonWorkerScriptChan}; use script_task::ScriptMsg; -use script_traits::ScriptControlChan; +use script_traits::{ConstellationControlMsg, ScriptControlChan}; use timers::{IsInterval, TimerId, TimerManager, TimerCallback}; use webdriver_handlers::jsval_to_webdriver; @@ -77,7 +77,7 @@ use std::mem as std_mem; use std::rc::Rc; use std::sync::Arc; use std::sync::mpsc::TryRecvError::{Empty, Disconnected}; -use std::sync::mpsc::{channel, Receiver}; +use std::sync::mpsc::{channel, Receiver, Sender}; use time; /// Current state of the window object @@ -112,7 +112,7 @@ pub struct Window { #[ignore_heap_size_of = "trait objects are hard"] script_chan: Box, #[ignore_heap_size_of = "channels are hard"] - control_chan: ScriptControlChan, + control_chan: Sender, console: MutNullableHeap>, crypto: MutNullableHeap>, navigator: MutNullableHeap>, @@ -744,7 +744,7 @@ impl<'a> WindowHelpers for &'a Window { }, document_root: root.to_trusted_node_address(), window_size: window_size, - script_chan: self.control_chan.clone(), + script_chan: ScriptControlChan(self.control_chan.clone()), script_join_chan: join_chan, id: last_reflow_id.get(), query_type: query_type, @@ -1073,7 +1073,7 @@ impl Window { page: Rc, script_chan: Box, image_cache_chan: ImageCacheChan, - control_chan: ScriptControlChan, + control_chan: Sender, compositor: ScriptListener, image_cache_task: ImageCacheTask, resource_task: Arc, diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 43c047c3231..6b170e5b1b2 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -60,7 +60,7 @@ use script_traits::CompositorEvent::{MouseDownEvent, MouseUpEvent}; use script_traits::CompositorEvent::{MouseMoveEvent, KeyEvent}; use script_traits::CompositorEvent::{ResizeEvent, ClickEvent}; use script_traits::{CompositorEvent, MouseButton}; -use script_traits::{ConstellationControlMsg, ScriptControlChan}; +use script_traits::ConstellationControlMsg; use script_traits::{NewLayoutInfo, OpaqueScriptLayoutChannel}; use script_traits::{ScriptState, ScriptTaskFactory}; use msg::compositor_msg::{LayerId, ScriptListener}; @@ -1466,7 +1466,7 @@ impl ScriptTask { page.clone(), self.chan.clone(), self.image_cache_channel.clone(), - ScriptControlChan(self.control_chan.clone()), + self.control_chan.clone(), self.compositor.borrow_mut().dup(), self.image_cache_task.clone(), self.resource_task.clone(),