aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/main/pipeline.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/main/pipeline.rs')
-rw-r--r--src/components/main/pipeline.rs37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/components/main/pipeline.rs b/src/components/main/pipeline.rs
index dcb14569c4c..e2a56c80e21 100644
--- a/src/components/main/pipeline.rs
+++ b/src/components/main/pipeline.rs
@@ -10,14 +10,23 @@ use gfx::opts::Opts;
use layout::layout_task::LayoutTask;
use script::layout_interface::LayoutChan;
use script::script_task::LoadMsg;
-use servo_msg::constellation::{ConstellationChan};
-use script::script_task::{ScriptTask, ScriptChan, ScriptMsg};
+use servo_msg::constellation_msg::{ConstellationChan, NavigationType};
+use script::script_task::{ScriptTask, ScriptChan};
use script::script_task;
use servo_net::image_cache_task::ImageCacheTask;
use servo_net::resource_task::ResourceTask;
use servo_util::time::ProfilerChan;
use std::comm;
+macro_rules! special_stream(
+ ($Chan:ident) => (
+ {
+ let (port, chan) = comm::stream::();
+ (port, $Chan::new(chan))
+ }
+ );
+)
+
/// A uniquely-identifiable pipeline of stript task, layout task, and render task.
pub struct Pipeline {
id: uint,
@@ -26,6 +35,7 @@ pub struct Pipeline {
render_chan: RenderChan,
/// The most recently loaded url
url: Option<Url>,
+ navigation_type: Option<NavigationType>,
}
impl Pipeline {
@@ -38,24 +48,12 @@ impl Pipeline {
profiler_chan: ProfilerChan,
opts: Opts) -> Pipeline {
- macro_rules! closure_stream(
- ($Msg:ty, $Chan:ident) => (
- {
- let (port, chan) = comm::stream::<$Msg>();
- (port, $Chan::new(chan))
- }
- );
- )
- // Create the script port and channel.
- let (script_port, script_chan) = closure_stream!(ScriptMsg, ScriptChan);
-
- // Create the layout port and channel.
- let (layout_port, layout_chan) = closure_stream!(layout_interface::Msg, LayoutChan);
-
- let (render_port, render_chan) = comm::stream::<render_task::Msg>();
- let render_chan = RenderChan::new(render_chan);
+ let (script_port, script_chan) = special_stream!(ScriptChan);
+ let (layout_port, layout_chan) = special_stream!(LayoutChan);
+ let (render_port, render_chan) = special_stream!(RenderChan);
- RenderTask::create(render_port,
+ RenderTask::create(id,
+ render_port,
compositor_chan.clone(),
copy opts,
constellation_chan.clone(),
@@ -94,6 +92,7 @@ impl Pipeline {
layout_chan: layout_chan,
render_chan: render_chan,
url: None,
+ navigation_type: None,
}
}