mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Pass a Sender<ConstellationControlMsg> to Pipeline::new.
This commit is contained in:
parent
250fdc33f4
commit
0aae98e9c0
2 changed files with 10 additions and 11 deletions
|
@ -41,7 +41,7 @@ use offscreen_gl_context::GLContextAttributes;
|
||||||
use profile_traits::mem;
|
use profile_traits::mem;
|
||||||
use profile_traits::time;
|
use profile_traits::time;
|
||||||
use script_traits::{CompositorEvent, ConstellationControlMsg, LayoutControlMsg};
|
use script_traits::{CompositorEvent, ConstellationControlMsg, LayoutControlMsg};
|
||||||
use script_traits::{ScriptControlChan, ScriptState, ScriptTaskFactory};
|
use script_traits::{ScriptState, ScriptTaskFactory};
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
|
@ -287,7 +287,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
fn new_pipeline(&mut self,
|
fn new_pipeline(&mut self,
|
||||||
parent_info: Option<(PipelineId, SubpageId)>,
|
parent_info: Option<(PipelineId, SubpageId)>,
|
||||||
initial_window_rect: Option<TypedRect<PagePx, f32>>,
|
initial_window_rect: Option<TypedRect<PagePx, f32>>,
|
||||||
script_channel: Option<ScriptControlChan>,
|
script_channel: Option<Sender<ConstellationControlMsg>>,
|
||||||
load_data: LoadData)
|
load_data: LoadData)
|
||||||
-> PipelineId {
|
-> PipelineId {
|
||||||
let pipeline_id = self.next_pipeline_id;
|
let pipeline_id = self.next_pipeline_id;
|
||||||
|
@ -648,7 +648,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
|
||||||
if same_script {
|
if same_script {
|
||||||
debug!("Constellation: loading same-origin iframe, \
|
debug!("Constellation: loading same-origin iframe, \
|
||||||
parent url {:?}, iframe url {:?}", source_url, url);
|
parent url {:?}, iframe url {:?}", source_url, url);
|
||||||
Some(ScriptControlChan(source_pipeline.script_chan.clone()))
|
Some(source_pipeline.script_chan.clone())
|
||||||
} else {
|
} else {
|
||||||
debug!("Constellation: loading cross-origin iframe, \
|
debug!("Constellation: loading cross-origin iframe, \
|
||||||
parent url {:?}, iframe url {:?}", source_url, url);
|
parent url {:?}, iframe url {:?}", source_url, url);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use CompositorProxy;
|
use CompositorProxy;
|
||||||
use layout_traits::{LayoutTaskFactory, LayoutControlChan};
|
use layout_traits::{LayoutTaskFactory, LayoutControlChan};
|
||||||
use script_traits::{LayoutControlMsg, ScriptControlChan, ScriptTaskFactory};
|
use script_traits::{LayoutControlMsg, ScriptTaskFactory};
|
||||||
use script_traits::{NewLayoutInfo, ConstellationControlMsg};
|
use script_traits::{NewLayoutInfo, ConstellationControlMsg};
|
||||||
|
|
||||||
use compositor_task;
|
use compositor_task;
|
||||||
|
@ -80,7 +80,7 @@ impl Pipeline {
|
||||||
time_profiler_chan: time::ProfilerChan,
|
time_profiler_chan: time::ProfilerChan,
|
||||||
mem_profiler_chan: profile_mem::ProfilerChan,
|
mem_profiler_chan: profile_mem::ProfilerChan,
|
||||||
window_rect: Option<TypedRect<PagePx, f32>>,
|
window_rect: Option<TypedRect<PagePx, f32>>,
|
||||||
script_chan: Option<ScriptControlChan>,
|
script_chan: Option<Sender<ConstellationControlMsg>>,
|
||||||
load_data: LoadData,
|
load_data: LoadData,
|
||||||
device_pixel_ratio: ScaleFactor<ViewportPx, DevicePixel, f32>)
|
device_pixel_ratio: ScaleFactor<ViewportPx, DevicePixel, f32>)
|
||||||
-> (Pipeline, PipelineContent)
|
-> (Pipeline, PipelineContent)
|
||||||
|
@ -131,14 +131,13 @@ impl Pipeline {
|
||||||
layout_shutdown_chan: layout_shutdown_chan.clone(),
|
layout_shutdown_chan: layout_shutdown_chan.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
script_chan.0
|
script_chan.send(ConstellationControlMsg::AttachLayout(new_layout_info))
|
||||||
.send(ConstellationControlMsg::AttachLayout(new_layout_info))
|
|
||||||
.unwrap();
|
.unwrap();
|
||||||
(script_chan, None)
|
(script_chan, None)
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let (script_chan, script_port) = channel();
|
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,
|
time_profiler_chan: time_profiler_chan,
|
||||||
mem_profiler_chan: mem_profiler_chan,
|
mem_profiler_chan: mem_profiler_chan,
|
||||||
window_size: window_size,
|
window_size: window_size,
|
||||||
script_chan: script_chan.0,
|
script_chan: script_chan,
|
||||||
load_data: load_data,
|
load_data: load_data,
|
||||||
failure: failure,
|
failure: failure,
|
||||||
script_port: script_port,
|
script_port: script_port,
|
||||||
|
@ -183,7 +182,7 @@ impl Pipeline {
|
||||||
|
|
||||||
pub fn new(id: PipelineId,
|
pub fn new(id: PipelineId,
|
||||||
parent_info: Option<(PipelineId, SubpageId)>,
|
parent_info: Option<(PipelineId, SubpageId)>,
|
||||||
script_chan: ScriptControlChan,
|
script_chan: Sender<ConstellationControlMsg>,
|
||||||
layout_chan: LayoutControlChan,
|
layout_chan: LayoutControlChan,
|
||||||
chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
|
chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
|
||||||
layout_shutdown_port: Receiver<()>,
|
layout_shutdown_port: Receiver<()>,
|
||||||
|
@ -194,7 +193,7 @@ impl Pipeline {
|
||||||
Pipeline {
|
Pipeline {
|
||||||
id: id,
|
id: id,
|
||||||
parent_info: parent_info,
|
parent_info: parent_info,
|
||||||
script_chan: script_chan.0,
|
script_chan: script_chan,
|
||||||
layout_chan: layout_chan,
|
layout_chan: layout_chan,
|
||||||
chrome_to_paint_chan: chrome_to_paint_chan,
|
chrome_to_paint_chan: chrome_to_paint_chan,
|
||||||
layout_shutdown_port: layout_shutdown_port,
|
layout_shutdown_port: layout_shutdown_port,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue