diff options
author | Keith Yeung <kungfukeith11@gmail.com> | 2015-11-14 16:01:34 -0800 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2015-11-16 23:10:53 -0800 |
commit | 19294db6e5ffc9e85b4b628ef8dc6c72636c70a7 (patch) | |
tree | 60c26784064e9fecc12f8bd7b44686ceb7b8472a /components/script | |
parent | afe03870ce1a5a65b4c22f2e64155259da8b4609 (diff) | |
download | servo-19294db6e5ffc9e85b4b628ef8dc6c72636c70a7.tar.gz servo-19294db6e5ffc9e85b4b628ef8dc6c72636c70a7.zip |
Split ConstellationMsg into ScriptMsg and CompositorMsg
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/clipboard_provider.rs | 4 | ||||
-rw-r--r-- | components/script/dom/bindings/global.rs | 3 | ||||
-rw-r--r-- | components/script/dom/bindings/trace.rs | 3 | ||||
-rw-r--r-- | components/script/dom/canvasrenderingcontext2d.rs | 2 | ||||
-rw-r--r-- | components/script/dom/document.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlbodyelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 3 | ||||
-rw-r--r-- | components/script/dom/htmllinkelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmltextareaelement.rs | 3 | ||||
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 2 | ||||
-rw-r--r-- | components/script/dom/window.rs | 7 | ||||
-rw-r--r-- | components/script/dom/workerglobalscope.rs | 7 | ||||
-rw-r--r-- | components/script/layout_interface.rs | 3 | ||||
-rw-r--r-- | components/script/script_task.rs | 4 |
15 files changed, 28 insertions, 21 deletions
diff --git a/components/script/clipboard_provider.rs b/components/script/clipboard_provider.rs index 81860f59eef..9038f0ed393 100644 --- a/components/script/clipboard_provider.rs +++ b/components/script/clipboard_provider.rs @@ -4,7 +4,7 @@ use ipc_channel::ipc; use msg::constellation_msg::ConstellationChan; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use std::borrow::ToOwned; use std::sync::mpsc::channel; @@ -15,7 +15,7 @@ pub trait ClipboardProvider { fn set_clipboard_contents(&mut self, String); } -impl ClipboardProvider for ConstellationChan { +impl ClipboardProvider for ConstellationChan<ConstellationMsg> { fn clipboard_contents(&mut self) -> String { let (tx, rx) = ipc::channel().unwrap(); self.0.send(ConstellationMsg::GetClipboardContents(tx)).unwrap(); diff --git a/components/script/dom/bindings/global.rs b/components/script/dom/bindings/global.rs index f3ae21e3212..da8d3dce87a 100644 --- a/components/script/dom/bindings/global.rs +++ b/components/script/dom/bindings/global.rs @@ -18,6 +18,7 @@ use ipc_channel::ipc::IpcSender; use js::jsapi::{GetGlobalForObjectCrossCompartment}; use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue}; use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL}; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId}; use net_traits::ResourceTask; use profile_traits::mem; @@ -91,7 +92,7 @@ impl<'a> GlobalRef<'a> { } /// Get a `ConstellationChan` to send messages to the constellation channel when available. - pub fn constellation_chan(&self) -> ConstellationChan { + pub fn constellation_chan(&self) -> ConstellationChan<ConstellationMsg> { match *self { GlobalRef::Window(window) => window.constellation_chan(), GlobalRef::Worker(worker) => worker.constellation_chan(), diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index e05670b9a6d..9218919720f 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -54,6 +54,7 @@ use js::rust::Runtime; use layout_interface::{LayoutChan, LayoutRPC}; use libc; use msg::constellation_msg::ConstellationChan; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData, WorkerId}; use net_traits::Metadata; use net_traits::image::base::Image; @@ -271,7 +272,7 @@ no_jsmanaged_fields!(WorkerId); no_jsmanaged_fields!(QuirksMode); no_jsmanaged_fields!(Runtime); no_jsmanaged_fields!(Headers, Method); -no_jsmanaged_fields!(ConstellationChan); +no_jsmanaged_fields!(ConstellationChan<ConstellationMsg>); no_jsmanaged_fields!(LayoutChan); no_jsmanaged_fields!(WindowProxyHandler); no_jsmanaged_fields!(UntrustedNodeAddress); diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 757f7e19cad..3cffea0f8c3 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -33,7 +33,7 @@ use euclid::point::Point2D; use euclid::rect::Rect; use euclid::size::Size2D; use ipc_channel::ipc::{self, IpcSender}; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use net_traits::image::base::PixelFormat; use net_traits::image_cache_task::ImageResponse; use num::{Float, ToPrimitive}; diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 1b8b99d90ec..108b68d9722 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -80,7 +80,7 @@ use layout_interface::{LayoutChan, Msg}; use layout_interface::{ReflowGoal, ReflowQueryType}; use msg::compositor_msg::ScriptToCompositorMsg; use msg::constellation_msg::AnimationState; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER}; use msg::constellation_msg::{ConstellationChan, FocusType, Key, KeyModifiers, KeyState, MozBrowserEvent, SubpageId}; use net_traits::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl}; diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index b7af752fdfc..32efe1bd53b 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -18,7 +18,7 @@ use dom::htmlelement::HTMLElement; use dom::node::{Node, document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; use msg::constellation_msg::ConstellationChan; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use std::rc::Rc; use string_cache::Atom; use time; diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index edb45fbb14b..b3e62ef434b 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -25,7 +25,7 @@ use dom::window::Window; use js::jsapi::{JSAutoCompartment, JSAutoRequest, RootedValue, JSContext, MutableHandleValue}; use js::jsval::{UndefinedValue, NullValue}; use msg::constellation_msg::IFrameSandboxState::{IFrameSandboxed, IFrameUnsandboxed}; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, IframeLoadInfo, MozBrowserEvent}; use msg::constellation_msg::{NavigationDirection, PipelineId, SubpageId}; use page::IterablePage; diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 8b638236818..35b9d3cd4e7 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -28,6 +28,7 @@ use dom::node::{document_from_node, window_from_node}; use dom::nodelist::NodeList; use dom::virtualmethods::VirtualMethods; use msg::constellation_msg::ConstellationChan; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use selectors::states::*; use std::borrow::ToOwned; use std::cell::Cell; @@ -64,7 +65,7 @@ pub struct HTMLInputElement { value_changed: Cell<bool>, size: Cell<u32>, #[ignore_heap_size_of = "#7193"] - textinput: DOMRefCell<TextInput<ConstellationChan>>, + textinput: DOMRefCell<TextInput<ConstellationChan<ConstellationMsg>>>, activation_state: DOMRefCell<InputActivationState>, } diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index a7365c38a69..bb470bf8d45 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -24,7 +24,7 @@ use encoding::all::UTF_8; use ipc_channel::ipc; use ipc_channel::router::ROUTER; use layout_interface::{LayoutChan, Msg}; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, MozBrowserEvent}; use net_traits::{AsyncResponseListener, AsyncResponseTarget, Metadata}; use network_listener::{NetworkListener, PreInvoke}; diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 76194a2044e..f84b38ca55c 100644 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -25,6 +25,7 @@ use dom::node::{document_from_node, window_from_node}; use dom::nodelist::NodeList; use dom::virtualmethods::VirtualMethods; use msg::constellation_msg::ConstellationChan; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use script_task::ScriptTaskEventCategory::InputEvent; use script_task::{CommonScriptMsg, Runnable}; use selectors::states::*; @@ -37,7 +38,7 @@ use util::str::DOMString; pub struct HTMLTextAreaElement { htmlelement: HTMLElement, #[ignore_heap_size_of = "#7193"] - textinput: DOMRefCell<TextInput<ConstellationChan>>, + textinput: DOMRefCell<TextInput<ConstellationChan<ConstellationMsg>>>, cols: Cell<u32>, rows: Cell<u32>, // https://html.spec.whatwg.org/multipage/#concept-textarea-dirty diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index a6da1d0d2ea..d21691f14af 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -31,7 +31,7 @@ use ipc_channel::ipc::{self, IpcSender}; use js::jsapi::{JSContext, JSObject, RootedValue}; use js::jsapi::{JS_GetFloat32ArrayData, JS_GetObjectAsArrayBufferView}; use js::jsval::{BooleanValue, Int32Value, JSVal, NullValue, UndefinedValue}; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use net_traits::image::base::PixelFormat; use net_traits::image_cache_task::ImageResponse; use offscreen_gl_context::GLContextAttributes; diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index cf7c85a160f..4cf2bbe881f 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -43,6 +43,7 @@ use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleRe use layout_interface::{LayoutChan, LayoutRPC, Msg, Reflow, ReflowGoal, ReflowQueryType}; use libc; use msg::compositor_msg::{LayerId, ScriptToCompositorMsg}; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, LoadData, PipelineId, SubpageId, WindowSizeData, WorkerId}; use msg::webdriver_msg::{WebDriverJSError, WebDriverJSResult}; use net_traits::ResourceTask; @@ -191,7 +192,7 @@ pub struct Window { /// A handle for communicating messages to the constellation task. #[ignore_heap_size_of = "channels are hard"] - constellation_chan: ConstellationChan, + constellation_chan: ConstellationChan<ConstellationMsg>, /// Pending scroll to fragment event, if any fragment_name: DOMRefCell<Option<String>>, @@ -1071,7 +1072,7 @@ impl Window { self.layout_chan.clone() } - pub fn constellation_chan(&self) -> ConstellationChan { + pub fn constellation_chan(&self) -> ConstellationChan<ConstellationMsg> { self.constellation_chan.clone() } @@ -1224,7 +1225,7 @@ impl Window { storage_task: StorageTask, mem_profiler_chan: mem::ProfilerChan, devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>, - constellation_chan: ConstellationChan, + constellation_chan: ConstellationChan<ConstellationMsg>, scheduler_chan: IpcSender<TimerEventRequest>, timer_event_chan: IpcSender<TimerEvent>, layout_chan: LayoutChan, diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index 3e49836e970..96a1786ff3c 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -20,6 +20,7 @@ use dom::workernavigator::WorkerNavigator; use ipc_channel::ipc::IpcSender; use js::jsapi::{HandleValue, JSAutoRequest, JSContext}; use js::rust::Runtime; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId}; use net_traits::{ResourceTask, load_whole_resource}; use profile_traits::mem; @@ -43,7 +44,7 @@ pub struct WorkerGlobalScopeInit { pub mem_profiler_chan: mem::ProfilerChan, pub to_devtools_sender: Option<IpcSender<ScriptToDevtoolsControlMsg>>, pub from_devtools_sender: Option<IpcSender<DevtoolScriptControlMsg>>, - pub constellation_chan: ConstellationChan, + pub constellation_chan: ConstellationChan<ConstellationMsg>, pub scheduler_chan: IpcSender<TimerEventRequest>, pub worker_id: WorkerId, } @@ -84,7 +85,7 @@ pub struct WorkerGlobalScope { devtools_wants_updates: Cell<bool>, #[ignore_heap_size_of = "Defined in std"] - constellation_chan: ConstellationChan, + constellation_chan: ConstellationChan<ConstellationMsg>, #[ignore_heap_size_of = "Defined in std"] scheduler_chan: IpcSender<TimerEventRequest>, @@ -135,7 +136,7 @@ impl WorkerGlobalScope { &self.from_devtools_receiver } - pub fn constellation_chan(&self) -> ConstellationChan { + pub fn constellation_chan(&self) -> ConstellationChan<ConstellationMsg> { self.constellation_chan.clone() } diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index 7c85d9c681e..cf9bae13e3b 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -14,6 +14,7 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender}; use libc::uintptr_t; use msg::compositor_msg::Epoch; use msg::compositor_msg::LayerId; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use msg::constellation_msg::{WindowSizeData}; use net_traits::image_cache_task::ImageCacheTask; @@ -251,7 +252,7 @@ pub struct NewLayoutTaskInfo { pub is_parent: bool, pub layout_pair: OpaqueScriptLayoutChannel, pub pipeline_port: IpcReceiver<LayoutControlMsg>, - pub constellation_chan: ConstellationChan, + pub constellation_chan: ConstellationChan<ConstellationMsg>, pub failure: Failure, pub script_chan: Sender<ConstellationControlMsg>, pub image_cache_task: ImageCacheTask, diff --git a/components/script/script_task.rs b/components/script/script_task.rs index d2fc0a93917..5a12d9e004f 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -62,7 +62,7 @@ use layout_interface::{self, LayoutChan, NewLayoutTaskInfo, ReflowGoal, ScriptLa use libc; use mem::heap_size_of_self_and_children; use msg::compositor_msg::{EventResult, LayerId, ScriptToCompositorMsg}; -use msg::constellation_msg::Msg as ConstellationMsg; +use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, FocusType, LoadData}; use msg::constellation_msg::{MozBrowserEvent, PipelineId}; use msg::constellation_msg::{PipelineNamespace}; @@ -403,7 +403,7 @@ pub struct ScriptTask { control_port: Receiver<ConstellationControlMsg>, /// For communicating load url messages to the constellation - constellation_chan: ConstellationChan, + constellation_chan: ConstellationChan<ConstellationMsg>, /// A handle to the compositor for communicating ready state messages. compositor: DOMRefCell<IpcSender<ScriptToCompositorMsg>>, |