Store a Sender<ConstellationControlMsg> in Window.

This commit is contained in:
Ms2ger 2015-08-12 15:34:41 +02:00
parent 26d191f068
commit 41ac66112a
2 changed files with 7 additions and 7 deletions

View file

@ -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<ScriptChan+Send>,
#[ignore_heap_size_of = "channels are hard"]
control_chan: ScriptControlChan,
control_chan: Sender<ConstellationControlMsg>,
console: MutNullableHeap<JS<Console>>,
crypto: MutNullableHeap<JS<Crypto>>,
navigator: MutNullableHeap<JS<Navigator>>,
@ -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<Page>,
script_chan: Box<ScriptChan+Send>,
image_cache_chan: ImageCacheChan,
control_chan: ScriptControlChan,
control_chan: Sender<ConstellationControlMsg>,
compositor: ScriptListener,
image_cache_task: ImageCacheTask,
resource_task: Arc<ResourceTask>,

View file

@ -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(),