Pass a Sender<ConstellationControlMsg> to Pipeline::new.

This commit is contained in:
Ms2ger 2015-08-12 16:19:30 +02:00
parent 250fdc33f4
commit 0aae98e9c0
2 changed files with 10 additions and 11 deletions

View file

@ -41,7 +41,7 @@ use offscreen_gl_context::GLContextAttributes;
use profile_traits::mem;
use profile_traits::time;
use script_traits::{CompositorEvent, ConstellationControlMsg, LayoutControlMsg};
use script_traits::{ScriptControlChan, ScriptState, ScriptTaskFactory};
use script_traits::{ScriptState, ScriptTaskFactory};
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::io::{self, Write};
@ -287,7 +287,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
fn new_pipeline(&mut self,
parent_info: Option<(PipelineId, SubpageId)>,
initial_window_rect: Option<TypedRect<PagePx, f32>>,
script_channel: Option<ScriptControlChan>,
script_channel: Option<Sender<ConstellationControlMsg>>,
load_data: LoadData)
-> PipelineId {
let pipeline_id = self.next_pipeline_id;
@ -648,7 +648,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
if same_script {
debug!("Constellation: loading same-origin iframe, \
parent url {:?}, iframe url {:?}", source_url, url);
Some(ScriptControlChan(source_pipeline.script_chan.clone()))
Some(source_pipeline.script_chan.clone())
} else {
debug!("Constellation: loading cross-origin iframe, \
parent url {:?}, iframe url {:?}", source_url, url);

View file

@ -4,7 +4,7 @@
use CompositorProxy;
use layout_traits::{LayoutTaskFactory, LayoutControlChan};
use script_traits::{LayoutControlMsg, ScriptControlChan, ScriptTaskFactory};
use script_traits::{LayoutControlMsg, ScriptTaskFactory};
use script_traits::{NewLayoutInfo, ConstellationControlMsg};
use compositor_task;
@ -80,7 +80,7 @@ impl Pipeline {
time_profiler_chan: time::ProfilerChan,
mem_profiler_chan: profile_mem::ProfilerChan,
window_rect: Option<TypedRect<PagePx, f32>>,
script_chan: Option<ScriptControlChan>,
script_chan: Option<Sender<ConstellationControlMsg>>,
load_data: LoadData,
device_pixel_ratio: ScaleFactor<ViewportPx, DevicePixel, f32>)
-> (Pipeline, PipelineContent)
@ -131,14 +131,13 @@ impl Pipeline {
layout_shutdown_chan: layout_shutdown_chan.clone(),
};
script_chan.0
.send(ConstellationControlMsg::AttachLayout(new_layout_info))
script_chan.send(ConstellationControlMsg::AttachLayout(new_layout_info))
.unwrap();
(script_chan, None)
}
None => {
let (script_chan, script_port) = channel();
(ScriptControlChan(script_chan), Some(script_port))
(script_chan, Some(script_port))
}
};
@ -165,7 +164,7 @@ impl Pipeline {
time_profiler_chan: time_profiler_chan,
mem_profiler_chan: mem_profiler_chan,
window_size: window_size,
script_chan: script_chan.0,
script_chan: script_chan,
load_data: load_data,
failure: failure,
script_port: script_port,
@ -183,7 +182,7 @@ impl Pipeline {
pub fn new(id: PipelineId,
parent_info: Option<(PipelineId, SubpageId)>,
script_chan: ScriptControlChan,
script_chan: Sender<ConstellationControlMsg>,
layout_chan: LayoutControlChan,
chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
layout_shutdown_port: Receiver<()>,
@ -194,7 +193,7 @@ impl Pipeline {
Pipeline {
id: id,
parent_info: parent_info,
script_chan: script_chan.0,
script_chan: script_chan,
layout_chan: layout_chan,
chrome_to_paint_chan: chrome_to_paint_chan,
layout_shutdown_port: layout_shutdown_port,