Rename constellation_msg::Msg variants.

This commit is contained in:
Ms2ger 2015-01-04 11:27:44 +01:00
parent d5cc791d31
commit de0caf8761
11 changed files with 85 additions and 82 deletions

View file

@ -31,10 +31,10 @@ use gleam::gl;
use script_traits::{ViewportMsg, ScriptControlChan}; use script_traits::{ViewportMsg, ScriptControlChan};
use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdlePaintState, LayerId}; use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdlePaintState, LayerId};
use servo_msg::compositor_msg::{ReadyState, PaintState, PaintingPaintState, Scrollable}; use servo_msg::compositor_msg::{ReadyState, PaintState, PaintingPaintState, Scrollable};
use servo_msg::constellation_msg::{mod, ConstellationChan, ExitMsg}; use servo_msg::constellation_msg::{mod, ConstellationChan};
use servo_msg::constellation_msg::{GetPipelineTitleMsg, Key, KeyModifiers, KeyState, LoadData}; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_msg::constellation_msg::{LoadUrlMsg, NavigateMsg, PipelineId, ResizedWindowMsg}; use servo_msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
use servo_msg::constellation_msg::{WindowSizeData}; use servo_msg::constellation_msg::{PipelineId, WindowSizeData};
use servo_util::geometry::{PagePx, ScreenPx, ViewportPx}; use servo_util::geometry::{PagePx, ScreenPx, ViewportPx};
use servo_util::memory::MemoryProfilerChan; use servo_util::memory::MemoryProfilerChan;
use servo_util::opts; use servo_util::opts;
@ -237,7 +237,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
(Msg::Exit(chan), _) => { (Msg::Exit(chan), _) => {
debug!("shutting down the constellation"); debug!("shutting down the constellation");
let ConstellationChan(ref con_chan) = self.constellation_chan; let ConstellationChan(ref con_chan) = self.constellation_chan;
con_chan.send(ExitMsg); con_chan.send(ConstellationMsg::Exit);
chan.send(()); chan.send(());
self.shutdown_state = ShutdownState::ShuttingDown; self.shutdown_state = ShutdownState::ShuttingDown;
} }
@ -589,7 +589,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
let visible_viewport = initial_viewport / self.viewport_zoom; let visible_viewport = initial_viewport / self.viewport_zoom;
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(ResizedWindowMsg(WindowSizeData { chan.send(ConstellationMsg::ResizedWindow(WindowSizeData {
device_pixel_ratio: dppx, device_pixel_ratio: dppx,
initial_viewport: initial_viewport, initial_viewport: initial_viewport,
visible_viewport: visible_viewport, visible_viewport: visible_viewport,
@ -754,7 +754,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
WindowEvent::Quit => { WindowEvent::Quit => {
debug!("shutting down the constellation for WindowEvent::Quit"); debug!("shutting down the constellation for WindowEvent::Quit");
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(ExitMsg); chan.send(ConstellationMsg::Exit);
self.shutdown_state = ShutdownState::ShuttingDown; self.shutdown_state = ShutdownState::ShuttingDown;
} }
} }
@ -789,7 +789,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
layers"), layers"),
}; };
let msg = LoadUrlMsg(root_pipeline_id, let msg = ConstellationMsg::LoadUrl(root_pipeline_id,
LoadData::new(Url::parse(url_string.as_slice()).unwrap())); LoadData::new(Url::parse(url_string.as_slice()).unwrap()));
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(msg); chan.send(msg);
@ -911,7 +911,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
windowing::WindowNavigateMsg::Back => constellation_msg::Back, windowing::WindowNavigateMsg::Back => constellation_msg::Back,
}; };
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(NavigateMsg(direction)) chan.send(ConstellationMsg::Navigate(direction))
} }
fn on_key_event(&self, key: Key, state: KeyState, modifiers: KeyModifiers) { fn on_key_event(&self, key: Key, state: KeyState, modifiers: KeyModifiers) {
@ -1130,7 +1130,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
debug!("shutting down the constellation after generating an output file"); debug!("shutting down the constellation after generating an output file");
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(ExitMsg); chan.send(ConstellationMsg::Exit);
self.shutdown_state = ShutdownState::ShuttingDown; self.shutdown_state = ShutdownState::ShuttingDown;
} }
@ -1340,6 +1340,6 @@ impl<Window> CompositorEventListener for IOCompositor<Window> where Window: Wind
Some(ref root_pipeline) => root_pipeline.id, Some(ref root_pipeline) => root_pipeline.id,
}; };
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(GetPipelineTitleMsg(root_pipeline_id)); chan.send(ConstellationMsg::GetPipelineTitle(root_pipeline_id));
} }
} }

View file

@ -17,14 +17,12 @@ use libc;
use script_traits::{mod, GetTitleMsg, ResizeMsg, ResizeInactiveMsg, SendEventMsg}; use script_traits::{mod, GetTitleMsg, ResizeMsg, ResizeInactiveMsg, SendEventMsg};
use script_traits::{ScriptControlChan, ScriptTaskFactory}; use script_traits::{ScriptControlChan, ScriptTaskFactory};
use servo_msg::compositor_msg::LayerId; use servo_msg::compositor_msg::LayerId;
use servo_msg::constellation_msg::{mod, ConstellationChan, ExitMsg, FailureMsg, Failure}; use servo_msg::constellation_msg::{mod, ConstellationChan, Failure};
use servo_msg::constellation_msg::{FrameRectMsg, GetPipelineTitleMsg}; use servo_msg::constellation_msg::{IFrameSandboxState, IFrameUnsandboxed};
use servo_msg::constellation_msg::{IFrameSandboxState, IFrameUnsandboxed, InitLoadUrlMsg}; use servo_msg::constellation_msg::{KeyEvent, Key, KeyState, KeyModifiers};
use servo_msg::constellation_msg::{KeyEvent, Key, KeyState, KeyModifiers, LoadCompleteMsg}; use servo_msg::constellation_msg::{LoadData, NavigationType};
use servo_msg::constellation_msg::{LoadData, LoadUrlMsg, NavigateMsg, NavigationType}; use servo_msg::constellation_msg::{PipelineExitType, PipelineId};
use servo_msg::constellation_msg::{PainterReadyMsg, PipelineExitType, PipelineId, ResizedWindowMsg}; use servo_msg::constellation_msg::{SubpageId, WindowSizeData};
use servo_msg::constellation_msg::{ScriptLoadedURLInIFrameMsg, SetCursorMsg, SubpageId};
use servo_msg::constellation_msg::{WindowSizeData};
use servo_msg::constellation_msg::Msg as ConstellationMsg; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient}; use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient};
use servo_net::resource_task::ResourceTask; use servo_net::resource_task::ResourceTask;
@ -446,65 +444,65 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
/// Handles loading pages, navigation, and granting access to the compositor /// Handles loading pages, navigation, and granting access to the compositor
fn handle_request(&mut self, request: ConstellationMsg) -> bool { fn handle_request(&mut self, request: ConstellationMsg) -> bool {
match request { match request {
ExitMsg => { ConstellationMsg::Exit => {
debug!("constellation exiting"); debug!("constellation exiting");
self.handle_exit(); self.handle_exit();
return false; return false;
} }
FailureMsg(Failure { pipeline_id, subpage_id }) => { ConstellationMsg::Failure(Failure { pipeline_id, subpage_id }) => {
self.handle_failure_msg(pipeline_id, subpage_id); self.handle_failure_msg(pipeline_id, subpage_id);
} }
// This should only be called once per constellation, and only by the browser // This should only be called once per constellation, and only by the browser
InitLoadUrlMsg(url) => { ConstellationMsg::InitLoadUrl(url) => {
debug!("constellation got init load URL message"); debug!("constellation got init load URL message");
self.handle_init_load(url); self.handle_init_load(url);
} }
// A layout assigned a size and position to a subframe. This needs to be reflected by // A layout assigned a size and position to a subframe. This needs to be reflected by
// all frame trees in the navigation context containing the subframe. // all frame trees in the navigation context containing the subframe.
FrameRectMsg(pipeline_id, subpage_id, rect) => { ConstellationMsg::FrameRect(pipeline_id, subpage_id, rect) => {
debug!("constellation got frame rect message"); debug!("constellation got frame rect message");
self.handle_frame_rect_msg(pipeline_id, subpage_id, Rect::from_untyped(&rect)); self.handle_frame_rect_msg(pipeline_id, subpage_id, Rect::from_untyped(&rect));
} }
ScriptLoadedURLInIFrameMsg(url, source_pipeline_id, subpage_id, sandbox) => { ConstellationMsg::ScriptLoadedURLInIFrame(url, source_pipeline_id, subpage_id, sandbox) => {
debug!("constellation got iframe URL load message"); debug!("constellation got iframe URL load message");
self.handle_script_loaded_url_in_iframe_msg(url, self.handle_script_loaded_url_in_iframe_msg(url,
source_pipeline_id, source_pipeline_id,
subpage_id, subpage_id,
sandbox); sandbox);
} }
SetCursorMsg(cursor) => self.handle_set_cursor_msg(cursor), ConstellationMsg::SetCursor(cursor) => self.handle_set_cursor_msg(cursor),
// Load a new page, usually -- but not always -- from a mouse click or typed url // Load a new page, usually -- but not always -- from a mouse click or typed url
// If there is already a pending page (self.pending_frames), it will not be overridden; // If there is already a pending page (self.pending_frames), it will not be overridden;
// However, if the id is not encompassed by another change, it will be. // However, if the id is not encompassed by another change, it will be.
LoadUrlMsg(source_id, load_data) => { ConstellationMsg::LoadUrl(source_id, load_data) => {
debug!("constellation got URL load message"); debug!("constellation got URL load message");
self.handle_load_url_msg(source_id, load_data); self.handle_load_url_msg(source_id, load_data);
} }
// A page loaded through one of several methods above has completed all parsing, // A page loaded through one of several methods above has completed all parsing,
// script, and reflow messages have been sent. // script, and reflow messages have been sent.
LoadCompleteMsg => { ConstellationMsg::LoadComplete => {
debug!("constellation got load complete message"); debug!("constellation got load complete message");
self.compositor_proxy.send(CompositorMsg::LoadComplete); self.compositor_proxy.send(CompositorMsg::LoadComplete);
} }
// Handle a forward or back request // Handle a forward or back request
NavigateMsg(direction) => { ConstellationMsg::Navigate(direction) => {
debug!("constellation got navigation message"); debug!("constellation got navigation message");
self.handle_navigate_msg(direction); self.handle_navigate_msg(direction);
} }
// Notification that painting has finished and is requesting permission to paint. // Notification that painting has finished and is requesting permission to paint.
PainterReadyMsg(pipeline_id) => { ConstellationMsg::PainterReady(pipeline_id) => {
debug!("constellation got painter ready message"); debug!("constellation got painter ready message");
self.handle_painter_ready_msg(pipeline_id); self.handle_painter_ready_msg(pipeline_id);
} }
ResizedWindowMsg(new_size) => { ConstellationMsg::ResizedWindow(new_size) => {
debug!("constellation got window resize message"); debug!("constellation got window resize message");
self.handle_resized_window_msg(new_size); self.handle_resized_window_msg(new_size);
} }
KeyEvent(key, state, modifiers) => { ConstellationMsg::KeyEvent(key, state, modifiers) => {
debug!("constellation got key event message"); debug!("constellation got key event message");
self.handle_key_msg(key, state, modifiers); self.handle_key_msg(key, state, modifiers);
} }
GetPipelineTitleMsg(pipeline_id) => { ConstellationMsg::GetPipelineTitle(pipeline_id) => {
debug!("constellation got get-pipeline-title message"); debug!("constellation got get-pipeline-title message");
self.handle_get_pipeline_title_msg(pipeline_id); self.handle_get_pipeline_title_msg(pipeline_id);
} }
@ -704,7 +702,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
// and add the new pipeline to their sub frames. // and add the new pipeline to their sub frames.
let frame_trees = self.find_all(source_pipeline_id); let frame_trees = self.find_all(source_pipeline_id);
if frame_trees.is_empty() { if frame_trees.is_empty() {
panic!("Constellation: source pipeline id of ScriptLoadedURLInIFrameMsg is not in panic!("Constellation: source pipeline id of ScriptLoadedURLInIFrame is not in
navigation context, nor is it in a pending frame. This should be navigation context, nor is it in a pending frame. This should be
impossible."); impossible.");
} }
@ -714,7 +712,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
// Compare the pipeline's url to the new url. If the origin is the same, // Compare the pipeline's url to the new url. If the origin is the same,
// then reuse the script task in creating the new pipeline // then reuse the script task in creating the new pipeline
let source_pipeline = self.pipelines.get(&source_pipeline_id).expect("Constellation: let source_pipeline = self.pipelines.get(&source_pipeline_id).expect("Constellation:
source Id of ScriptLoadedURLInIFrameMsg does have an associated pipeline in source Id of ScriptLoadedURLInIFrame does have an associated pipeline in
constellation. This should be impossible.").clone(); constellation. This should be impossible.").clone();
let source_url = source_pipeline.load_data.url.clone(); let source_url = source_pipeline.load_data.url.clone();
@ -759,7 +757,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
debug!("Constellation: received message to load {}", url); debug!("Constellation: received message to load {}", url);
// Make sure no pending page would be overridden. // Make sure no pending page would be overridden.
let source_frame = self.current_frame().as_ref().unwrap().find(source_id).expect( let source_frame = self.current_frame().as_ref().unwrap().find(source_id).expect(
"Constellation: received a LoadUrlMsg from a pipeline_id associated "Constellation: received a LoadUrl message from a pipeline_id associated
with a pipeline not in the active frame tree. This should be with a pipeline not in the active frame tree. This should be
impossible."); impossible.");

View file

@ -7,7 +7,8 @@ use windowing::WindowEvent;
use geom::scale_factor::ScaleFactor; use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D; use geom::size::TypedSize2D;
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, ResizedWindowMsg, WindowSizeData}; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_msg::constellation_msg::{ConstellationChan, WindowSizeData};
use servo_util::memory::MemoryProfilerChan; use servo_util::memory::MemoryProfilerChan;
use servo_util::memory; use servo_util::memory;
use servo_util::time::TimeProfilerChan; use servo_util::time::TimeProfilerChan;
@ -55,7 +56,7 @@ impl NullCompositor {
// Tell the constellation about the initial fake size. // Tell the constellation about the initial fake size.
{ {
let ConstellationChan(ref chan) = compositor.constellation_chan; let ConstellationChan(ref chan) = compositor.constellation_chan;
chan.send(ResizedWindowMsg(WindowSizeData { chan.send(ConstellationMsg::ResizedWindow(WindowSizeData {
initial_viewport: TypedSize2D(640_f32, 480_f32), initial_viewport: TypedSize2D(640_f32, 480_f32),
visible_viewport: TypedSize2D(640_f32, 480_f32), visible_viewport: TypedSize2D(640_f32, 480_f32),
device_pixel_ratio: ScaleFactor(1.0), device_pixel_ratio: ScaleFactor(1.0),
@ -72,7 +73,7 @@ impl CompositorEventListener for NullCompositor {
Msg::Exit(chan) => { Msg::Exit(chan) => {
debug!("shutting down the constellation"); debug!("shutting down the constellation");
let ConstellationChan(ref con_chan) = self.constellation_chan; let ConstellationChan(ref con_chan) = self.constellation_chan;
con_chan.send(ExitMsg); con_chan.send(ConstellationMsg::Exit);
chan.send(()); chan.send(());
} }

View file

@ -11,7 +11,7 @@ use devtools_traits::DevtoolsControlChan;
use gfx::paint_task::Msg as PaintMsg; use gfx::paint_task::Msg as PaintMsg;
use gfx::paint_task::{PaintPermissionGranted, PaintPermissionRevoked}; use gfx::paint_task::{PaintPermissionGranted, PaintPermissionRevoked};
use gfx::paint_task::{PaintChan, PaintTask}; use gfx::paint_task::{PaintChan, PaintTask};
use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, Failure, PipelineId, SubpageId}; use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId, SubpageId};
use servo_msg::constellation_msg::{LoadData, WindowSizeData, PipelineExitType}; use servo_msg::constellation_msg::{LoadData, WindowSizeData, PipelineExitType};
use servo_net::image_cache_task::ImageCacheTask; use servo_net::image_cache_task::ImageCacheTask;
use gfx::font_cache_task::FontCacheTask; use gfx::font_cache_task::FontCacheTask;

View file

@ -23,8 +23,9 @@ use layers;
use native::task::NativeTaskBuilder; use native::task::NativeTaskBuilder;
use servo_msg::compositor_msg::{Epoch, IdlePaintState, LayerId}; use servo_msg::compositor_msg::{Epoch, IdlePaintState, LayerId};
use servo_msg::compositor_msg::{LayerMetadata, PaintListener, PaintingPaintState, ScrollPolicy}; use servo_msg::compositor_msg::{LayerMetadata, PaintListener, PaintingPaintState, ScrollPolicy};
use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineExitType}; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_msg::constellation_msg::{PipelineId, PainterReadyMsg}; use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
use servo_msg::constellation_msg::PipelineExitType;
use servo_msg::platform::surface::NativeSurfaceAzureMethods; use servo_msg::platform::surface::NativeSurfaceAzureMethods;
use servo_util::geometry::{Au, ZERO_POINT}; use servo_util::geometry::{Au, ZERO_POINT};
use servo_util::opts; use servo_util::opts;
@ -224,7 +225,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
debug!("paint_task: shutdown_chan send"); debug!("paint_task: shutdown_chan send");
shutdown_chan.send(()); shutdown_chan.send(());
}, FailureMsg(failure_msg), c, true); }, ConstellationMsg::Failure(failure_msg), c, true);
} }
fn start(&mut self) { fn start(&mut self) {
@ -241,7 +242,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
if !self.paint_permission { if !self.paint_permission {
debug!("PaintTask: paint ready msg"); debug!("PaintTask: paint ready msg");
let ConstellationChan(ref mut c) = self.constellation_chan; let ConstellationChan(ref mut c) = self.constellation_chan;
c.send(PainterReadyMsg(self.id)); c.send(ConstellationMsg::PainterReady(self.id));
continue; continue;
} }
@ -254,7 +255,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
if !self.paint_permission { if !self.paint_permission {
debug!("PaintTask: paint ready msg"); debug!("PaintTask: paint ready msg");
let ConstellationChan(ref mut c) = self.constellation_chan; let ConstellationChan(ref mut c) = self.constellation_chan;
c.send(PainterReadyMsg(self.id)); c.send(ConstellationMsg::PainterReady(self.id));
self.compositor.paint_msg_discarded(); self.compositor.paint_msg_discarded();
continue; continue;
} }

View file

@ -32,7 +32,8 @@ use gfx::display_list::{SidewaysRight, SolidColorDisplayItem};
use gfx::display_list::{StackingContext, TextDisplayItem, Upright}; use gfx::display_list::{StackingContext, TextDisplayItem, Upright};
use gfx::paint_task::PaintLayer; use gfx::paint_task::PaintLayer;
use servo_msg::compositor_msg::{FixedPosition, Scrollable}; use servo_msg::compositor_msg::{FixedPosition, Scrollable};
use servo_msg::constellation_msg::{ConstellationChan, FrameRectMsg}; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_msg::constellation_msg::ConstellationChan;
use servo_net::image::holder::ImageHolder; use servo_net::image::holder::ImageHolder;
use servo_util::cursor::{DefaultCursor, TextCursor, VerticalTextCursor}; use servo_util::cursor::{DefaultCursor, TextCursor, VerticalTextCursor};
use servo_util::geometry::{mod, Au, ZERO_POINT}; use servo_util::geometry::{mod, Au, ZERO_POINT};
@ -904,7 +905,7 @@ impl FragmentDisplayListBuilding for Fragment {
iframe_fragment.pipeline_id, iframe_fragment.pipeline_id,
iframe_fragment.subpage_id); iframe_fragment.subpage_id);
let ConstellationChan(ref chan) = layout_context.shared.constellation_chan; let ConstellationChan(ref chan) = layout_context.shared.constellation_chan;
chan.send(FrameRectMsg(iframe_fragment.pipeline_id, chan.send(ConstellationMsg::FrameRect(iframe_fragment.pipeline_id,
iframe_fragment.subpage_id, iframe_fragment.subpage_id,
iframe_rect)); iframe_rect));
} }

View file

@ -43,8 +43,9 @@ use script::layout_interface::{Reflow, ReflowGoal, ScriptLayoutChan, TrustedNode
use script_traits::{SendEventMsg, ReflowEvent, ReflowCompleteMsg, OpaqueScriptLayoutChannel}; use script_traits::{SendEventMsg, ReflowEvent, ReflowCompleteMsg, OpaqueScriptLayoutChannel};
use script_traits::{ScriptControlChan, UntrustedNodeAddress}; use script_traits::{ScriptControlChan, UntrustedNodeAddress};
use servo_msg::compositor_msg::Scrollable; use servo_msg::compositor_msg::Scrollable;
use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineExitType}; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_msg::constellation_msg::{PipelineId, SetCursorMsg}; use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType};
use servo_msg::constellation_msg::PipelineId;
use servo_net::image_cache_task::{ImageCacheTask, ImageResponseMsg}; use servo_net::image_cache_task::{ImageCacheTask, ImageResponseMsg};
use servo_net::local_image_cache::{ImageResponder, LocalImageCache}; use servo_net::local_image_cache::{ImageResponder, LocalImageCache};
use servo_net::resource_task::{ResourceTask, load_bytes_iter}; use servo_net::resource_task::{ResourceTask, load_bytes_iter};
@ -200,7 +201,7 @@ impl LayoutTaskFactory for LayoutTask {
layout.start(); layout.start();
} }
shutdown_chan.send(()); shutdown_chan.send(());
}, FailureMsg(failure_msg), con_chan, false); }, ConstellationMsg::Failure(failure_msg), con_chan, false);
} }
} }
@ -999,7 +1000,7 @@ impl LayoutRPC for LayoutRPCImpl {
DefaultCursor DefaultCursor
}; };
let ConstellationChan(ref constellation_chan) = rw_data.constellation_chan; let ConstellationChan(ref constellation_chan) = rw_data.constellation_chan;
constellation_chan.send(SetCursorMsg(cursor)); constellation_chan.send(ConstellationMsg::SetCursor(cursor));
} }
if mouse_over_list.is_empty() { if mouse_over_list.is_empty() {

View file

@ -195,26 +195,26 @@ bitflags! {
/// Messages from the compositor and script to the constellation. /// Messages from the compositor and script to the constellation.
pub enum Msg { pub enum Msg {
ExitMsg, Exit,
FailureMsg(Failure), Failure(Failure),
InitLoadUrlMsg(Url), InitLoadUrl(Url),
LoadCompleteMsg, LoadComplete,
FrameRectMsg(PipelineId, SubpageId, Rect<f32>), FrameRect(PipelineId, SubpageId, Rect<f32>),
LoadUrlMsg(PipelineId, LoadData), LoadUrl(PipelineId, LoadData),
ScriptLoadedURLInIFrameMsg(Url, PipelineId, SubpageId, IFrameSandboxState), ScriptLoadedURLInIFrame(Url, PipelineId, SubpageId, IFrameSandboxState),
NavigateMsg(NavigationDirection), Navigate(NavigationDirection),
PainterReadyMsg(PipelineId), PainterReady(PipelineId),
ResizedWindowMsg(WindowSizeData), ResizedWindow(WindowSizeData),
KeyEvent(Key, KeyState, KeyModifiers), KeyEvent(Key, KeyState, KeyModifiers),
/// Requests that the constellation inform the compositor of the title of the pipeline /// Requests that the constellation inform the compositor of the title of the pipeline
/// immediately. /// immediately.
GetPipelineTitleMsg(PipelineId), GetPipelineTitle(PipelineId),
/// Requests that the constellation inform the compositor of the a cursor change. /// Requests that the constellation inform the compositor of the a cursor change.
SetCursorMsg(Cursor), SetCursor(Cursor),
} }
/// Similar to net::resource_task::LoadData /// Similar to net::resource_task::LoadData
/// can be passed to LoadUrlMsg to load a page with GET/POST /// can be passed to LoadUrl to load a page with GET/POST
/// parameters or headers /// parameters or headers
#[deriving(Clone)] #[deriving(Clone)]
pub struct LoadData { pub struct LoadData {

View file

@ -21,9 +21,9 @@ use dom::virtualmethods::VirtualMethods;
use dom::window::Window; use dom::window::Window;
use page::IterablePage; use page::IterablePage;
use servo_msg::constellation_msg::{PipelineId, SubpageId}; use servo_msg::constellation_msg::{PipelineId, SubpageId, ConstellationChan};
use servo_msg::constellation_msg::{IFrameSandboxed, IFrameUnsandboxed}; use servo_msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed};
use servo_msg::constellation_msg::{ConstellationChan, ScriptLoadedURLInIFrameMsg}; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_util::str::DOMString; use servo_util::str::DOMString;
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
@ -122,7 +122,7 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
})); }));
let ConstellationChan(ref chan) = page.constellation_chan; let ConstellationChan(ref chan) = page.constellation_chan;
chan.send(ScriptLoadedURLInIFrameMsg(url, page.id, subpage_id, sandboxed)); chan.send(ConstellationMsg::ScriptLoadedURLInIFrame(url, page.id, subpage_id, sandboxed));
} }
} }

View file

@ -45,13 +45,12 @@ use script_traits::{ResizeInactiveMsg, ExitPipelineMsg, NewLayoutInfo, OpaqueScr
use script_traits::{ScriptControlChan, ReflowCompleteMsg, SendEventMsg}; use script_traits::{ScriptControlChan, ReflowCompleteMsg, SendEventMsg};
use servo_msg::compositor_msg::{FinishedLoading, LayerId, Loading, PerformingLayout}; use servo_msg::compositor_msg::{FinishedLoading, LayerId, Loading, PerformingLayout};
use servo_msg::compositor_msg::{ScriptListener}; use servo_msg::compositor_msg::{ScriptListener};
use servo_msg::constellation_msg::{ConstellationChan, LoadCompleteMsg}; use servo_msg::constellation_msg::{ConstellationChan};
use servo_msg::constellation_msg::{LoadData, LoadUrlMsg, NavigationDirection, PipelineId}; use servo_msg::constellation_msg::{LoadData, NavigationDirection, PipelineId};
use servo_msg::constellation_msg::{Failure, FailureMsg, WindowSizeData, Key, KeyState}; use servo_msg::constellation_msg::{Failure, Msg, WindowSizeData, Key, KeyState};
use servo_msg::constellation_msg::{KeyModifiers, SUPER, SHIFT, CONTROL, ALT, Repeated, Pressed}; use servo_msg::constellation_msg::{KeyModifiers, SUPER, SHIFT, CONTROL, ALT};
use servo_msg::constellation_msg::{Released};
use servo_msg::constellation_msg::{PipelineExitType}; use servo_msg::constellation_msg::{PipelineExitType};
use servo_msg::constellation_msg; use servo_msg::constellation_msg::Msg as ConstellationMsg;
use servo_net::image_cache_task::ImageCacheTask; use servo_net::image_cache_task::ImageCacheTask;
use servo_net::resource_task::{ResourceTask, Load}; use servo_net::resource_task::{ResourceTask, Load};
use servo_net::resource_task::LoadData as NetLoadData; use servo_net::resource_task::LoadData as NetLoadData;
@ -315,7 +314,7 @@ impl ScriptTaskFactory for ScriptTask {
// This must always be the very last operation performed before the task completes // This must always be the very last operation performed before the task completes
failsafe.neuter(); failsafe.neuter();
}, FailureMsg(failure_msg), const_chan, false); }, ConstellationMsg::Failure(failure_msg), const_chan, false);
} }
} }
@ -681,7 +680,7 @@ impl ScriptTask {
/// TODO(tkuehn): is it ever possible to navigate only on a subframe? /// TODO(tkuehn): is it ever possible to navigate only on a subframe?
fn handle_navigate_msg(&self, direction: NavigationDirection) { fn handle_navigate_msg(&self, direction: NavigationDirection) {
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(constellation_msg::NavigateMsg(direction)); chan.send(ConstellationMsg::Navigate(direction));
} }
/// Window was resized, but this script was not active, so don't reflow yet /// Window was resized, but this script was not active, so don't reflow yet
@ -886,7 +885,7 @@ impl ScriptTask {
*page.fragment_name.borrow_mut() = final_url.fragment.clone(); *page.fragment_name.borrow_mut() = final_url.fragment.clone();
let ConstellationChan(ref chan) = self.constellation_chan; let ConstellationChan(ref chan) = self.constellation_chan;
chan.send(LoadCompleteMsg); chan.send(ConstellationMsg::LoadComplete);
// Notify devtools that a new script global exists. // Notify devtools that a new script global exists.
match self.devtools_chan { match self.devtools_chan {
@ -1058,7 +1057,7 @@ impl ScriptTask {
/// for the given pipeline. /// for the given pipeline.
fn trigger_load(&self, pipeline_id: PipelineId, load_data: LoadData) { fn trigger_load(&self, pipeline_id: PipelineId, load_data: LoadData) {
let ConstellationChan(ref const_chan) = self.constellation_chan; let ConstellationChan(ref const_chan) = self.constellation_chan;
const_chan.send(LoadUrlMsg(pipeline_id, load_data)); const_chan.send(ConstellationMsg::LoadUrl(pipeline_id, load_data));
} }
/// The entry point for content to notify that a fragment url has been requested /// The entry point for content to notify that a fragment url has been requested

View file

@ -30,7 +30,9 @@ use compositing::windowing::{WindowEvent, WindowMethods};
#[cfg(not(test))] #[cfg(not(test))]
use compositing::{CompositorProxy, CompositorTask, Constellation}; use compositing::{CompositorProxy, CompositorTask, Constellation};
#[cfg(not(test))] #[cfg(not(test))]
use servo_msg::constellation_msg::{ConstellationChan, InitLoadUrlMsg}; use servo_msg::constellation_msg::Msg as ConstellationMsg;
#[cfg(not(test))]
use servo_msg::constellation_msg::ConstellationChan;
#[cfg(not(test))] #[cfg(not(test))]
use script::dom::bindings::codegen::RegisterBindings; use script::dom::bindings::codegen::RegisterBindings;
@ -120,7 +122,7 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
}; };
let ConstellationChan(ref chan) = constellation_chan; let ConstellationChan(ref chan) = constellation_chan;
chan.send(InitLoadUrlMsg(url)); chan.send(ConstellationMsg::InitLoadUrl(url));
} }
// Send the constallation Chan as the result // Send the constallation Chan as the result