mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Remove the paint shutdown channel.
Nobody is listening.
This commit is contained in:
parent
021b9e3239
commit
32842d5c42
2 changed files with 26 additions and 41 deletions
|
@ -55,7 +55,6 @@ pub struct Pipeline {
|
||||||
/// A channel to the compositor.
|
/// A channel to the compositor.
|
||||||
pub compositor_proxy: Box<CompositorProxy + 'static + Send>,
|
pub compositor_proxy: Box<CompositorProxy + 'static + Send>,
|
||||||
pub chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
|
pub chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
|
||||||
pub paint_shutdown_port: IpcReceiver<()>,
|
|
||||||
/// URL corresponding to the most recently-loaded page.
|
/// URL corresponding to the most recently-loaded page.
|
||||||
pub url: Url,
|
pub url: Url,
|
||||||
/// The title of the most recently-loaded page.
|
/// The title of the most recently-loaded page.
|
||||||
|
@ -129,8 +128,6 @@ impl Pipeline {
|
||||||
// probably requires a general low-memory strategy.
|
// probably requires a general low-memory strategy.
|
||||||
let (layout_to_paint_chan, layout_to_paint_port) = util::ipc::optional_ipc_channel();
|
let (layout_to_paint_chan, layout_to_paint_port) = util::ipc::optional_ipc_channel();
|
||||||
let (chrome_to_paint_chan, chrome_to_paint_port) = channel();
|
let (chrome_to_paint_chan, chrome_to_paint_port) = channel();
|
||||||
let (paint_shutdown_chan, paint_shutdown_port) = ipc::channel()
|
|
||||||
.expect("Pipeline paint shutdown chan");
|
|
||||||
let (pipeline_chan, pipeline_port) = ipc::channel()
|
let (pipeline_chan, pipeline_port) = ipc::channel()
|
||||||
.expect("Pipeline main chan");;
|
.expect("Pipeline main chan");;
|
||||||
|
|
||||||
|
@ -173,8 +170,7 @@ impl Pipeline {
|
||||||
state.panic_chan.clone(),
|
state.panic_chan.clone(),
|
||||||
state.font_cache_thread.clone(),
|
state.font_cache_thread.clone(),
|
||||||
state.time_profiler_chan.clone(),
|
state.time_profiler_chan.clone(),
|
||||||
state.mem_profiler_chan.clone(),
|
state.mem_profiler_chan.clone());
|
||||||
paint_shutdown_chan);
|
|
||||||
|
|
||||||
let mut child_process = None;
|
let mut child_process = None;
|
||||||
if let Some((script_port, pipeline_port)) = content_ports {
|
if let Some((script_port, pipeline_port)) = content_ports {
|
||||||
|
@ -252,7 +248,6 @@ impl Pipeline {
|
||||||
pipeline_chan,
|
pipeline_chan,
|
||||||
state.compositor_proxy,
|
state.compositor_proxy,
|
||||||
chrome_to_paint_chan,
|
chrome_to_paint_chan,
|
||||||
paint_shutdown_port,
|
|
||||||
state.load_data.url,
|
state.load_data.url,
|
||||||
state.window_size);
|
state.window_size);
|
||||||
|
|
||||||
|
@ -265,7 +260,6 @@ impl Pipeline {
|
||||||
layout_chan: IpcSender<LayoutControlMsg>,
|
layout_chan: IpcSender<LayoutControlMsg>,
|
||||||
compositor_proxy: Box<CompositorProxy + 'static + Send>,
|
compositor_proxy: Box<CompositorProxy + 'static + Send>,
|
||||||
chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
|
chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
|
||||||
paint_shutdown_port: IpcReceiver<()>,
|
|
||||||
url: Url,
|
url: Url,
|
||||||
size: Option<TypedSize2D<PagePx, f32>>)
|
size: Option<TypedSize2D<PagePx, f32>>)
|
||||||
-> Pipeline {
|
-> Pipeline {
|
||||||
|
@ -276,7 +270,6 @@ impl Pipeline {
|
||||||
layout_chan: layout_chan,
|
layout_chan: layout_chan,
|
||||||
compositor_proxy: compositor_proxy,
|
compositor_proxy: compositor_proxy,
|
||||||
chrome_to_paint_chan: chrome_to_paint_chan,
|
chrome_to_paint_chan: chrome_to_paint_chan,
|
||||||
paint_shutdown_port: paint_shutdown_port,
|
|
||||||
url: url,
|
url: url,
|
||||||
title: None,
|
title: None,
|
||||||
children: vec!(),
|
children: vec!(),
|
||||||
|
|
|
@ -396,46 +396,38 @@ impl<C> PaintThread<C> where C: PaintListener + Send + 'static {
|
||||||
panic_chan: IpcSender<PanicMsg>,
|
panic_chan: IpcSender<PanicMsg>,
|
||||||
font_cache_thread: FontCacheThread,
|
font_cache_thread: FontCacheThread,
|
||||||
time_profiler_chan: time::ProfilerChan,
|
time_profiler_chan: time::ProfilerChan,
|
||||||
mem_profiler_chan: mem::ProfilerChan,
|
mem_profiler_chan: mem::ProfilerChan) {
|
||||||
shutdown_chan: IpcSender<()>) {
|
|
||||||
thread::spawn_named_with_send_on_panic(format!("PaintThread {:?}", id),
|
thread::spawn_named_with_send_on_panic(format!("PaintThread {:?}", id),
|
||||||
thread_state::PAINT,
|
thread_state::PAINT,
|
||||||
move || {
|
move || {
|
||||||
{
|
let native_display = compositor.native_display();
|
||||||
// Ensures that the paint thread and graphics context are destroyed before the
|
let worker_threads = WorkerThreadProxy::spawn(native_display,
|
||||||
// shutdown message.
|
font_cache_thread,
|
||||||
let native_display = compositor.native_display();
|
time_profiler_chan.clone());
|
||||||
let worker_threads = WorkerThreadProxy::spawn(native_display,
|
|
||||||
font_cache_thread,
|
|
||||||
time_profiler_chan.clone());
|
|
||||||
|
|
||||||
let mut paint_thread = PaintThread {
|
let mut paint_thread = PaintThread {
|
||||||
id: id,
|
id: id,
|
||||||
_url: url,
|
_url: url,
|
||||||
layout_to_paint_port: layout_to_paint_port,
|
layout_to_paint_port: layout_to_paint_port,
|
||||||
chrome_to_paint_port: chrome_to_paint_port,
|
chrome_to_paint_port: chrome_to_paint_port,
|
||||||
compositor: compositor,
|
compositor: compositor,
|
||||||
time_profiler_chan: time_profiler_chan,
|
time_profiler_chan: time_profiler_chan,
|
||||||
root_display_list: None,
|
root_display_list: None,
|
||||||
layer_map: HashMap::new(),
|
layer_map: HashMap::new(),
|
||||||
paint_permission: false,
|
paint_permission: false,
|
||||||
current_epoch: None,
|
current_epoch: None,
|
||||||
worker_threads: worker_threads,
|
worker_threads: worker_threads,
|
||||||
};
|
};
|
||||||
|
|
||||||
let reporter_name = format!("paint-reporter-{}", id);
|
let reporter_name = format!("paint-reporter-{}", id);
|
||||||
mem_profiler_chan.run_with_memory_reporting(|| {
|
mem_profiler_chan.run_with_memory_reporting(|| {
|
||||||
paint_thread.start();
|
paint_thread.start();
|
||||||
}, reporter_name, chrome_to_paint_chan, ChromeToPaintMsg::CollectReports);
|
}, reporter_name, chrome_to_paint_chan, ChromeToPaintMsg::CollectReports);
|
||||||
|
|
||||||
// Tell all the worker threads to shut down.
|
// Tell all the worker threads to shut down.
|
||||||
for worker_thread in &mut paint_thread.worker_threads {
|
for worker_thread in &mut paint_thread.worker_threads {
|
||||||
worker_thread.exit()
|
worker_thread.exit()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("paint_thread: shutdown_chan send");
|
|
||||||
let _ = shutdown_chan.send(());
|
|
||||||
}, Some(id), panic_chan);
|
}, Some(id), panic_chan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue