@@ -62,7 +62,7 @@ use script_traits::{CompositorEvent, MouseButton};
6262use script_traits:: ConstellationControlMsg ;
6363use script_traits:: { NewLayoutInfo , OpaqueScriptLayoutChannel } ;
6464use script_traits:: { ScriptState , ScriptTaskFactory } ;
65- use msg:: compositor_msg:: { LayerId , ScriptListener } ;
65+ use msg:: compositor_msg:: { LayerId , ScriptToCompositorMsg } ;
6666use msg:: constellation_msg:: { ConstellationChan , FocusType } ;
6767use msg:: constellation_msg:: { LoadData , PipelineId , SubpageId , MozBrowserEvent , WorkerId } ;
6868use msg:: constellation_msg:: { Failure , WindowSizeData , PipelineExitType } ;
@@ -361,7 +361,7 @@ pub struct ScriptTask {
361361 constellation_chan : ConstellationChan ,
362362
363363 /// A handle to the compositor for communicating ready state messages.
364- compositor : DOMRefCell < ScriptListener > ,
364+ compositor : DOMRefCell < IpcSender < ScriptToCompositorMsg > > ,
365365
366366 /// The port on which we receive messages from the image cache
367367 image_cache_port : Receiver < ImageCacheResult > ,
@@ -443,7 +443,7 @@ impl ScriptTaskFactory for ScriptTask {
443443 fn create ( _phantom : Option < & mut ScriptTask > ,
444444 id : PipelineId ,
445445 parent_info : Option < ( PipelineId , SubpageId ) > ,
446- compositor : ScriptListener ,
446+ compositor : IpcSender < ScriptToCompositorMsg > ,
447447 layout_chan : & OpaqueScriptLayoutChannel ,
448448 control_chan : Sender < ConstellationControlMsg > ,
449449 control_port : Receiver < ConstellationControlMsg > ,
@@ -579,7 +579,7 @@ impl ScriptTask {
579579 }
580580
581581 /// Creates a new script task.
582- pub fn new ( compositor : ScriptListener ,
582+ pub fn new ( compositor : IpcSender < ScriptToCompositorMsg > ,
583583 port : Receiver < MainThreadScriptMsg > ,
584584 chan : MainThreadScriptChan ,
585585 control_chan : Sender < ConstellationControlMsg > ,
@@ -1329,7 +1329,7 @@ impl ScriptTask {
13291329 // TODO(tkuehn): currently there is only one window,
13301330 // so this can afford to be naive and just shut down the
13311331 // compositor. In the future it'll need to be smarter.
1332- self . compositor . borrow_mut ( ) . close ( ) ;
1332+ self . compositor . borrow_mut ( ) . send ( ScriptToCompositorMsg :: Exit ) . unwrap ( ) ;
13331333 }
13341334
13351335 /// We have received notification that the response associated with a load has completed.
@@ -1506,7 +1506,7 @@ impl ScriptTask {
15061506 MainThreadScriptChan ( sender. clone ( ) ) ,
15071507 self . image_cache_channel . clone ( ) ,
15081508 self . control_chan . clone ( ) ,
1509- self . compositor . borrow_mut ( ) . dup ( ) ,
1509+ self . compositor . borrow_mut ( ) . clone ( ) ,
15101510 self . image_cache_task . clone ( ) ,
15111511 self . resource_task . clone ( ) ,
15121512 self . storage_task . clone ( ) ,
@@ -1601,7 +1601,8 @@ impl ScriptTask {
16011601 // Really what needs to happen is that this needs to go through layout to ask which
16021602 // layer the element belongs to, and have it send the scroll message to the
16031603 // compositor.
1604- self . compositor . borrow_mut ( ) . scroll_fragment_point ( pipeline_id, LayerId :: null ( ) , point) ;
1604+ self . compositor . borrow_mut ( ) . send ( ScriptToCompositorMsg :: ScrollFragmentPoint (
1605+ pipeline_id, LayerId :: null ( ) , point) ) . unwrap ( ) ;
16051606 }
16061607
16071608 /// Reflows non-incrementally, rebuilding the entire layout tree in the process.
@@ -1699,7 +1700,7 @@ impl ScriptTask {
16991700 let page = get_page ( & self . root_page ( ) , pipeline_id) ;
17001701 let document = page. document ( ) ;
17011702 document. r ( ) . dispatch_key_event (
1702- key, state, modifiers, & mut * self . compositor . borrow_mut ( ) ) ;
1703+ key, state, modifiers, & mut self . compositor . borrow_mut ( ) ) ;
17031704 }
17041705 }
17051706 }
0 commit comments