diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-01-04 11:27:44 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-01-04 11:59:21 +0100 |
commit | de0caf8761459e8d51a8250a12babb7e80b24649 (patch) | |
tree | af8d2ce0a4c0904ac4376ed49d615e04e00aa485 | |
parent | d5cc791d3109c67f3086ed282011b8ff6299cca3 (diff) | |
download | servo-de0caf8761459e8d51a8250a12babb7e80b24649.tar.gz servo-de0caf8761459e8d51a8250a12babb7e80b24649.zip |
Rename constellation_msg::Msg variants.
-rw-r--r-- | components/compositing/compositor.rs | 24 | ||||
-rw-r--r-- | components/compositing/constellation.rs | 46 | ||||
-rw-r--r-- | components/compositing/headless.rs | 7 | ||||
-rw-r--r-- | components/compositing/pipeline.rs | 2 | ||||
-rw-r--r-- | components/gfx/paint_task.rs | 11 | ||||
-rw-r--r-- | components/layout/display_list_builder.rs | 9 | ||||
-rw-r--r-- | components/layout/layout_task.rs | 9 | ||||
-rw-r--r-- | components/msg/constellation_msg.rs | 26 | ||||
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 8 | ||||
-rw-r--r-- | components/script/script_task.rs | 19 | ||||
-rw-r--r-- | components/servo/lib.rs | 6 |
11 files changed, 85 insertions, 82 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index a13b75a4ad2..c02956c2207 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -31,10 +31,10 @@ use gleam::gl; use script_traits::{ViewportMsg, ScriptControlChan}; use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdlePaintState, LayerId}; use servo_msg::compositor_msg::{ReadyState, PaintState, PaintingPaintState, Scrollable}; -use servo_msg::constellation_msg::{mod, ConstellationChan, ExitMsg}; -use servo_msg::constellation_msg::{GetPipelineTitleMsg, Key, KeyModifiers, KeyState, LoadData}; -use servo_msg::constellation_msg::{LoadUrlMsg, NavigateMsg, PipelineId, ResizedWindowMsg}; -use servo_msg::constellation_msg::{WindowSizeData}; +use servo_msg::constellation_msg::{mod, ConstellationChan}; +use servo_msg::constellation_msg::Msg as ConstellationMsg; +use servo_msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; +use servo_msg::constellation_msg::{PipelineId, WindowSizeData}; use servo_util::geometry::{PagePx, ScreenPx, ViewportPx}; use servo_util::memory::MemoryProfilerChan; use servo_util::opts; @@ -237,7 +237,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { (Msg::Exit(chan), _) => { debug!("shutting down the constellation"); let ConstellationChan(ref con_chan) = self.constellation_chan; - con_chan.send(ExitMsg); + con_chan.send(ConstellationMsg::Exit); chan.send(()); self.shutdown_state = ShutdownState::ShuttingDown; } @@ -589,7 +589,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { let visible_viewport = initial_viewport / self.viewport_zoom; let ConstellationChan(ref chan) = self.constellation_chan; - chan.send(ResizedWindowMsg(WindowSizeData { + chan.send(ConstellationMsg::ResizedWindow(WindowSizeData { device_pixel_ratio: dppx, initial_viewport: initial_viewport, visible_viewport: visible_viewport, @@ -754,7 +754,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { WindowEvent::Quit => { debug!("shutting down the constellation for WindowEvent::Quit"); let ConstellationChan(ref chan) = self.constellation_chan; - chan.send(ExitMsg); + chan.send(ConstellationMsg::Exit); self.shutdown_state = ShutdownState::ShuttingDown; } } @@ -789,8 +789,8 @@ impl<Window: WindowMethods> IOCompositor<Window> { layers"), }; - let msg = LoadUrlMsg(root_pipeline_id, - LoadData::new(Url::parse(url_string.as_slice()).unwrap())); + let msg = ConstellationMsg::LoadUrl(root_pipeline_id, + LoadData::new(Url::parse(url_string.as_slice()).unwrap())); let ConstellationChan(ref chan) = self.constellation_chan; chan.send(msg); } @@ -911,7 +911,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { windowing::WindowNavigateMsg::Back => constellation_msg::Back, }; 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) { @@ -1130,7 +1130,7 @@ impl<Window: WindowMethods> IOCompositor<Window> { debug!("shutting down the constellation after generating an output file"); let ConstellationChan(ref chan) = self.constellation_chan; - chan.send(ExitMsg); + chan.send(ConstellationMsg::Exit); 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, }; let ConstellationChan(ref chan) = self.constellation_chan; - chan.send(GetPipelineTitleMsg(root_pipeline_id)); + chan.send(ConstellationMsg::GetPipelineTitle(root_pipeline_id)); } } diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 5d64dec93b1..44f87cce401 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -17,14 +17,12 @@ use libc; use script_traits::{mod, GetTitleMsg, ResizeMsg, ResizeInactiveMsg, SendEventMsg}; use script_traits::{ScriptControlChan, ScriptTaskFactory}; use servo_msg::compositor_msg::LayerId; -use servo_msg::constellation_msg::{mod, ConstellationChan, ExitMsg, FailureMsg, Failure}; -use servo_msg::constellation_msg::{FrameRectMsg, GetPipelineTitleMsg}; -use servo_msg::constellation_msg::{IFrameSandboxState, IFrameUnsandboxed, InitLoadUrlMsg}; -use servo_msg::constellation_msg::{KeyEvent, Key, KeyState, KeyModifiers, LoadCompleteMsg}; -use servo_msg::constellation_msg::{LoadData, LoadUrlMsg, NavigateMsg, NavigationType}; -use servo_msg::constellation_msg::{PainterReadyMsg, PipelineExitType, PipelineId, ResizedWindowMsg}; -use servo_msg::constellation_msg::{ScriptLoadedURLInIFrameMsg, SetCursorMsg, SubpageId}; -use servo_msg::constellation_msg::{WindowSizeData}; +use servo_msg::constellation_msg::{mod, ConstellationChan, Failure}; +use servo_msg::constellation_msg::{IFrameSandboxState, IFrameUnsandboxed}; +use servo_msg::constellation_msg::{KeyEvent, Key, KeyState, KeyModifiers}; +use servo_msg::constellation_msg::{LoadData, NavigationType}; +use servo_msg::constellation_msg::{PipelineExitType, PipelineId}; +use servo_msg::constellation_msg::{SubpageId, WindowSizeData}; use servo_msg::constellation_msg::Msg as ConstellationMsg; use servo_net::image_cache_task::{ImageCacheTask, ImageCacheTaskClient}; 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 fn handle_request(&mut self, request: ConstellationMsg) -> bool { match request { - ExitMsg => { + ConstellationMsg::Exit => { debug!("constellation exiting"); self.handle_exit(); return false; } - FailureMsg(Failure { pipeline_id, subpage_id }) => { + ConstellationMsg::Failure(Failure { 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 - InitLoadUrlMsg(url) => { + ConstellationMsg::InitLoadUrl(url) => { debug!("constellation got init load URL message"); self.handle_init_load(url); } // 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. - FrameRectMsg(pipeline_id, subpage_id, rect) => { + ConstellationMsg::FrameRect(pipeline_id, subpage_id, rect) => { debug!("constellation got frame rect message"); 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"); self.handle_script_loaded_url_in_iframe_msg(url, source_pipeline_id, subpage_id, 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 // 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. - LoadUrlMsg(source_id, load_data) => { + ConstellationMsg::LoadUrl(source_id, load_data) => { debug!("constellation got URL load message"); self.handle_load_url_msg(source_id, load_data); } // A page loaded through one of several methods above has completed all parsing, // script, and reflow messages have been sent. - LoadCompleteMsg => { + ConstellationMsg::LoadComplete => { debug!("constellation got load complete message"); self.compositor_proxy.send(CompositorMsg::LoadComplete); } // Handle a forward or back request - NavigateMsg(direction) => { + ConstellationMsg::Navigate(direction) => { debug!("constellation got navigation message"); self.handle_navigate_msg(direction); } // Notification that painting has finished and is requesting permission to paint. - PainterReadyMsg(pipeline_id) => { + ConstellationMsg::PainterReady(pipeline_id) => { debug!("constellation got painter ready message"); self.handle_painter_ready_msg(pipeline_id); } - ResizedWindowMsg(new_size) => { + ConstellationMsg::ResizedWindow(new_size) => { debug!("constellation got window resize message"); self.handle_resized_window_msg(new_size); } - KeyEvent(key, state, modifiers) => { + ConstellationMsg::KeyEvent(key, state, modifiers) => { debug!("constellation got key event message"); self.handle_key_msg(key, state, modifiers); } - GetPipelineTitleMsg(pipeline_id) => { + ConstellationMsg::GetPipelineTitle(pipeline_id) => { debug!("constellation got get-pipeline-title message"); 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. let frame_trees = self.find_all(source_pipeline_id); 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 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, // then reuse the script task in creating the new pipeline 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(); 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); // Make sure no pending page would be overridden. 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 impossible."); diff --git a/components/compositing/headless.rs b/components/compositing/headless.rs index e2ed207b274..a7464a6723a 100644 --- a/components/compositing/headless.rs +++ b/components/compositing/headless.rs @@ -7,7 +7,8 @@ use windowing::WindowEvent; use geom::scale_factor::ScaleFactor; 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; use servo_util::time::TimeProfilerChan; @@ -55,7 +56,7 @@ impl NullCompositor { // Tell the constellation about the initial fake size. { let ConstellationChan(ref chan) = compositor.constellation_chan; - chan.send(ResizedWindowMsg(WindowSizeData { + chan.send(ConstellationMsg::ResizedWindow(WindowSizeData { initial_viewport: TypedSize2D(640_f32, 480_f32), visible_viewport: TypedSize2D(640_f32, 480_f32), device_pixel_ratio: ScaleFactor(1.0), @@ -72,7 +73,7 @@ impl CompositorEventListener for NullCompositor { Msg::Exit(chan) => { debug!("shutting down the constellation"); let ConstellationChan(ref con_chan) = self.constellation_chan; - con_chan.send(ExitMsg); + con_chan.send(ConstellationMsg::Exit); chan.send(()); } diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 822fc0c51e6..a8096894257 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -11,7 +11,7 @@ use devtools_traits::DevtoolsControlChan; use gfx::paint_task::Msg as PaintMsg; use gfx::paint_task::{PaintPermissionGranted, PaintPermissionRevoked}; 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_net::image_cache_task::ImageCacheTask; use gfx::font_cache_task::FontCacheTask; diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 747de7ef44c..b6e03422c59 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -23,8 +23,9 @@ use layers; use native::task::NativeTaskBuilder; use servo_msg::compositor_msg::{Epoch, IdlePaintState, LayerId}; use servo_msg::compositor_msg::{LayerMetadata, PaintListener, PaintingPaintState, ScrollPolicy}; -use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineExitType}; -use servo_msg::constellation_msg::{PipelineId, PainterReadyMsg}; +use servo_msg::constellation_msg::Msg as ConstellationMsg; +use servo_msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; +use servo_msg::constellation_msg::PipelineExitType; use servo_msg::platform::surface::NativeSurfaceAzureMethods; use servo_util::geometry::{Au, ZERO_POINT}; use servo_util::opts; @@ -224,7 +225,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send { debug!("paint_task: shutdown_chan send"); shutdown_chan.send(()); - }, FailureMsg(failure_msg), c, true); + }, ConstellationMsg::Failure(failure_msg), c, true); } fn start(&mut self) { @@ -241,7 +242,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send { if !self.paint_permission { debug!("PaintTask: paint ready msg"); let ConstellationChan(ref mut c) = self.constellation_chan; - c.send(PainterReadyMsg(self.id)); + c.send(ConstellationMsg::PainterReady(self.id)); continue; } @@ -254,7 +255,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send { if !self.paint_permission { debug!("PaintTask: paint ready msg"); let ConstellationChan(ref mut c) = self.constellation_chan; - c.send(PainterReadyMsg(self.id)); + c.send(ConstellationMsg::PainterReady(self.id)); self.compositor.paint_msg_discarded(); continue; } diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 662e79d0846..a9ca6d5f547 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -32,7 +32,8 @@ use gfx::display_list::{SidewaysRight, SolidColorDisplayItem}; use gfx::display_list::{StackingContext, TextDisplayItem, Upright}; use gfx::paint_task::PaintLayer; 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_util::cursor::{DefaultCursor, TextCursor, VerticalTextCursor}; use servo_util::geometry::{mod, Au, ZERO_POINT}; @@ -904,9 +905,9 @@ impl FragmentDisplayListBuilding for Fragment { iframe_fragment.pipeline_id, iframe_fragment.subpage_id); let ConstellationChan(ref chan) = layout_context.shared.constellation_chan; - chan.send(FrameRectMsg(iframe_fragment.pipeline_id, - iframe_fragment.subpage_id, - iframe_rect)); + chan.send(ConstellationMsg::FrameRect(iframe_fragment.pipeline_id, + iframe_fragment.subpage_id, + iframe_rect)); } fn clipping_region_for_children(&self, current_clip: &ClippingRegion, flow_origin: &Point2D<Au>) diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 3cb4b9d5e31..72865373f3f 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -43,8 +43,9 @@ use script::layout_interface::{Reflow, ReflowGoal, ScriptLayoutChan, TrustedNode use script_traits::{SendEventMsg, ReflowEvent, ReflowCompleteMsg, OpaqueScriptLayoutChannel}; use script_traits::{ScriptControlChan, UntrustedNodeAddress}; use servo_msg::compositor_msg::Scrollable; -use servo_msg::constellation_msg::{ConstellationChan, Failure, FailureMsg, PipelineExitType}; -use servo_msg::constellation_msg::{PipelineId, SetCursorMsg}; +use servo_msg::constellation_msg::Msg as ConstellationMsg; +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::local_image_cache::{ImageResponder, LocalImageCache}; use servo_net::resource_task::{ResourceTask, load_bytes_iter}; @@ -200,7 +201,7 @@ impl LayoutTaskFactory for LayoutTask { layout.start(); } 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 }; 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() { diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index e9e69c669c7..c472bf2292a 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -195,26 +195,26 @@ bitflags! { /// Messages from the compositor and script to the constellation. pub enum Msg { - ExitMsg, - FailureMsg(Failure), - InitLoadUrlMsg(Url), - LoadCompleteMsg, - FrameRectMsg(PipelineId, SubpageId, Rect<f32>), - LoadUrlMsg(PipelineId, LoadData), - ScriptLoadedURLInIFrameMsg(Url, PipelineId, SubpageId, IFrameSandboxState), - NavigateMsg(NavigationDirection), - PainterReadyMsg(PipelineId), - ResizedWindowMsg(WindowSizeData), + Exit, + Failure(Failure), + InitLoadUrl(Url), + LoadComplete, + FrameRect(PipelineId, SubpageId, Rect<f32>), + LoadUrl(PipelineId, LoadData), + ScriptLoadedURLInIFrame(Url, PipelineId, SubpageId, IFrameSandboxState), + Navigate(NavigationDirection), + PainterReady(PipelineId), + ResizedWindow(WindowSizeData), KeyEvent(Key, KeyState, KeyModifiers), /// Requests that the constellation inform the compositor of the title of the pipeline /// immediately. - GetPipelineTitleMsg(PipelineId), + GetPipelineTitle(PipelineId), /// Requests that the constellation inform the compositor of the a cursor change. - SetCursorMsg(Cursor), + SetCursor(Cursor), } /// 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 #[deriving(Clone)] pub struct LoadData { diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index bc2c6a6b73b..b36b2a664ec 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -21,9 +21,9 @@ use dom::virtualmethods::VirtualMethods; use dom::window::Window; use page::IterablePage; -use servo_msg::constellation_msg::{PipelineId, SubpageId}; -use servo_msg::constellation_msg::{IFrameSandboxed, IFrameUnsandboxed}; -use servo_msg::constellation_msg::{ConstellationChan, ScriptLoadedURLInIFrameMsg}; +use servo_msg::constellation_msg::{PipelineId, SubpageId, ConstellationChan}; +use servo_msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; +use servo_msg::constellation_msg::Msg as ConstellationMsg; use servo_util::str::DOMString; use std::ascii::AsciiExt; @@ -122,7 +122,7 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> { })); 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)); } } diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 91899233b45..990c8476f6a 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -45,13 +45,12 @@ use script_traits::{ResizeInactiveMsg, ExitPipelineMsg, NewLayoutInfo, OpaqueScr use script_traits::{ScriptControlChan, ReflowCompleteMsg, SendEventMsg}; use servo_msg::compositor_msg::{FinishedLoading, LayerId, Loading, PerformingLayout}; use servo_msg::compositor_msg::{ScriptListener}; -use servo_msg::constellation_msg::{ConstellationChan, LoadCompleteMsg}; -use servo_msg::constellation_msg::{LoadData, LoadUrlMsg, NavigationDirection, PipelineId}; -use servo_msg::constellation_msg::{Failure, FailureMsg, WindowSizeData, Key, KeyState}; -use servo_msg::constellation_msg::{KeyModifiers, SUPER, SHIFT, CONTROL, ALT, Repeated, Pressed}; -use servo_msg::constellation_msg::{Released}; +use servo_msg::constellation_msg::{ConstellationChan}; +use servo_msg::constellation_msg::{LoadData, NavigationDirection, PipelineId}; +use servo_msg::constellation_msg::{Failure, Msg, WindowSizeData, Key, KeyState}; +use servo_msg::constellation_msg::{KeyModifiers, SUPER, SHIFT, CONTROL, ALT}; 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::resource_task::{ResourceTask, Load}; 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 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? fn handle_navigate_msg(&self, direction: NavigationDirection) { 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 @@ -886,7 +885,7 @@ impl ScriptTask { *page.fragment_name.borrow_mut() = final_url.fragment.clone(); let ConstellationChan(ref chan) = self.constellation_chan; - chan.send(LoadCompleteMsg); + chan.send(ConstellationMsg::LoadComplete); // Notify devtools that a new script global exists. match self.devtools_chan { @@ -1058,7 +1057,7 @@ impl ScriptTask { /// for the given pipeline. fn trigger_load(&self, pipeline_id: PipelineId, load_data: LoadData) { 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 diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 6d623eaed1c..bf64a9a4951 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -30,7 +30,9 @@ use compositing::windowing::{WindowEvent, WindowMethods}; #[cfg(not(test))] use compositing::{CompositorProxy, CompositorTask, Constellation}; #[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))] use script::dom::bindings::codegen::RegisterBindings; @@ -120,7 +122,7 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { }; let ConstellationChan(ref chan) = constellation_chan; - chan.send(InitLoadUrlMsg(url)); + chan.send(ConstellationMsg::InitLoadUrl(url)); } // Send the constallation Chan as the result |