diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 1f352ae27e4..0ea23e80d45 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -165,7 +165,6 @@ impl Pipeline { load_data: state.load_data.clone(), window_size: window_size, pipeline_port: pipeline_port, - layout_to_constellation_chan: state.layout_to_constellation_chan.clone(), content_process_shutdown_chan: Some(layout_content_process_shutdown_chan.clone()), layout_threads: PREFS.get("layout.threads").as_u64().expect("count") as usize, }; @@ -424,6 +423,7 @@ impl UnprivilegedPipelineContent { control_chan: self.script_chan.clone(), control_port: self.script_port, constellation_chan: self.constellation_chan, + layout_to_constellation_chan: self.layout_to_constellation_chan.clone(), scheduler_chan: self.scheduler_chan, bluetooth_thread: self.bluetooth_thread, resource_threads: self.resource_threads, diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index b902c6df101..e7a1f95ec9d 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -82,7 +82,7 @@ use script_layout_interface::message::{self, NewLayoutThreadInfo, ReflowQueryTyp use script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory, EnqueuedPromiseCallback}; use script_runtime::{ScriptPort, StackRootTLS, get_reports, new_rt_and_cx, PromiseJobQueue}; use script_traits::{CompositorEvent, ConstellationControlMsg, EventResult}; -use script_traits::{InitialScriptState, LoadData, MouseButton, MouseEventType, MozBrowserEvent}; +use script_traits::{InitialScriptState, LayoutMsg, LoadData, MouseButton, MouseEventType, MozBrowserEvent}; use script_traits::{NewLayoutInfo, ScriptMsg as ConstellationMsg}; use script_traits::{ScriptThreadFactory, TimerEvent, TimerEventRequest, TimerSource}; use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress, WindowSizeData, WindowSizeType}; @@ -434,6 +434,9 @@ pub struct ScriptThread { /// For communicating load url messages to the constellation constellation_chan: IpcSender, + /// A sender for new layout threads to communicate to the constellation. + layout_to_constellation_chan: IpcSender, + /// The port on which we receive messages from the image cache image_cache_port: Receiver, @@ -681,6 +684,8 @@ impl ScriptThread { content_process_shutdown_chan: state.content_process_shutdown_chan, promise_job_queue: PromiseJobQueue::new(), + + layout_to_constellation_chan: state.layout_to_constellation_chan, } } @@ -1179,7 +1184,6 @@ impl ScriptThread { load_data, window_size, pipeline_port, - layout_to_constellation_chan, content_process_shutdown_chan, layout_threads, } = new_layout_info; @@ -1193,7 +1197,7 @@ impl ScriptThread { is_parent: false, layout_pair: layout_pair, pipeline_port: pipeline_port, - constellation_chan: layout_to_constellation_chan, + constellation_chan: self.layout_to_constellation_chan.clone(), script_chan: self.control_chan.clone(), image_cache_thread: self.image_cache_thread.clone(), content_process_shutdown_chan: content_process_shutdown_chan, diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 290d51ae4e0..8c51aa22841 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -177,8 +177,6 @@ pub struct NewLayoutInfo { pub window_size: Option, /// A port on which layout can receive messages from the pipeline. pub pipeline_port: IpcReceiver, - /// A sender for the layout thread to communicate to the constellation. - pub layout_to_constellation_chan: IpcSender, /// A shutdown channel so that layout can tell the content process to shut down when it's done. pub content_process_shutdown_chan: Option>, /// Number of threads to use for layout. @@ -450,6 +448,8 @@ pub struct InitialScriptState { pub control_port: IpcReceiver, /// A channel on which messages can be sent to the constellation from script. pub constellation_chan: IpcSender, + /// A sender for the layout thread to communicate to the constellation. + pub layout_to_constellation_chan: IpcSender, /// A channel to schedule timer events. pub scheduler_chan: IpcSender, /// A channel to the resource manager thread.