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

Make the layout content process shutdown sender optional.

  • Loading branch information
Ms2ger committed Nov 30, 2016
commit c044b669794204d77925c5b09706d1242daa534a
@@ -166,7 +166,7 @@ impl Pipeline {
window_size: window_size,
pipeline_port: pipeline_port,
layout_to_constellation_chan: state.layout_to_constellation_chan.clone(),
content_process_shutdown_chan: layout_content_process_shutdown_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,
};

@@ -448,7 +448,7 @@ impl UnprivilegedPipelineContent {
self.font_cache_thread,
self.time_profiler_chan,
self.mem_profiler_chan,
self.layout_content_process_shutdown_chan,
Some(self.layout_content_process_shutdown_chan),
self.webrender_api_sender,
self.prefs.get("layout.threads").expect("exists").value()
.as_u64().expect("count") as usize);
@@ -246,7 +246,7 @@ impl LayoutThreadFactory for LayoutThread {
font_cache_thread: FontCacheThread,
time_profiler_chan: time::ProfilerChan,
mem_profiler_chan: mem::ProfilerChan,
content_process_shutdown_chan: IpcSender<()>,
content_process_shutdown_chan: Option<IpcSender<()>>,
webrender_api_sender: webrender_traits::RenderApiSender,
layout_threads: usize) {
thread::spawn_named(format!("LayoutThread {:?}", id),
@@ -278,7 +278,9 @@ impl LayoutThreadFactory for LayoutThread {
layout.start();
}, reporter_name, sender, Msg::CollectReports);
}
let _ = content_process_shutdown_chan.send(());
if let Some(content_process_shutdown_chan) = content_process_shutdown_chan {

This comment has been minimized.

@jdm

jdm Oct 31, 2016

Member

It's not clear to me what the effect of this change is. Why is it ok to not have one for about:blank layout threads?

This comment has been minimized.

@Ms2ger

Ms2ger Nov 2, 2016

Author Contributor

We only listen on the receiver if we spawned a new script thread (or process) for the new pipeline; about:blank always lives in its parent's script thread. I could create a channel and immediately drop the receiver, but that seemed pointless.

let _ = content_process_shutdown_chan.send(());
}
});
}
}
@@ -44,7 +44,7 @@ pub trait LayoutThreadFactory {
font_cache_thread: FontCacheThread,
time_profiler_chan: time::ProfilerChan,
mem_profiler_chan: mem::ProfilerChan,
content_process_shutdown_chan: IpcSender<()>,
content_process_shutdown_chan: Option<IpcSender<()>>,
webrender_api_sender: webrender_traits::RenderApiSender,
layout_threads: usize);
}
@@ -142,6 +142,6 @@ pub struct NewLayoutThreadInfo {
pub constellation_chan: IpcSender<ConstellationMsg>,
pub script_chan: IpcSender<ConstellationControlMsg>,
pub image_cache_thread: ImageCacheThread,
pub content_process_shutdown_chan: IpcSender<()>,
pub content_process_shutdown_chan: Option<IpcSender<()>>,
pub layout_threads: usize,
}
@@ -180,7 +180,7 @@ pub struct NewLayoutInfo {
/// 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: IpcSender<()>,
pub content_process_shutdown_chan: Option<IpcSender<()>>,
/// Number of threads to use for layout.
pub layout_threads: usize,
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.