Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement synchronous about:blank loading. #13996

Merged
merged 6 commits into from Dec 1, 2016

Store the layout-to-constellation sender in the script thread.

This will allow the script thread to spawn layout threads independently.
  • Loading branch information
Ms2ger committed Nov 30, 2016
commit 14459e22119c076904794e1a47c777f69d10e2d8
@@ -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,
@@ -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<ConstellationMsg>,

/// A sender for new layout threads to communicate to the constellation.
layout_to_constellation_chan: IpcSender<LayoutMsg>,

This comment has been minimized.

@jdm

jdm Nov 24, 2016

Member

/// A sender for new layout threads to communicate to the constellation.


/// The port on which we receive messages from the image cache
image_cache_port: Receiver<ImageCacheResult>,

@@ -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,
@@ -177,8 +177,6 @@ pub struct NewLayoutInfo {
pub window_size: Option<WindowSizeData>,
/// A port on which layout can receive messages from the pipeline.
pub pipeline_port: IpcReceiver<LayoutControlMsg>,
/// A sender for the layout thread to communicate to the constellation.
pub layout_to_constellation_chan: IpcSender<LayoutMsg>,
/// A shutdown channel so that layout can tell the content process to shut down when it's done.
pub content_process_shutdown_chan: Option<IpcSender<()>>,
/// Number of threads to use for layout.
@@ -450,6 +448,8 @@ pub struct InitialScriptState {
pub control_port: IpcReceiver<ConstellationControlMsg>,
/// A channel on which messages can be sent to the constellation from script.
pub constellation_chan: IpcSender<ScriptMsg>,
/// A sender for the layout thread to communicate to the constellation.
pub layout_to_constellation_chan: IpcSender<LayoutMsg>,
/// A channel to schedule timer events.
pub scheduler_chan: IpcSender<TimerEventRequest>,
/// A channel to the resource manager thread.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.