mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Some debugging improvements and code style nits across gfx and constellation.
* Propagate the RUST_LOG env var to the child process * Add debug information when a recv() fails in paint thread's select!.
This commit is contained in:
parent
702445a3ec
commit
354dc66029
4 changed files with 17 additions and 6 deletions
|
@ -1323,10 +1323,13 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_alert(&mut self, pipeline_id: PipelineId, message: String, sender: IpcSender<bool>) {
|
fn handle_alert(&mut self,
|
||||||
|
pipeline_id: PipelineId,
|
||||||
|
message: String,
|
||||||
|
sender: IpcSender<bool>) {
|
||||||
let display_alert_dialog = if PREFS.is_mozbrowser_enabled() {
|
let display_alert_dialog = if PREFS.is_mozbrowser_enabled() {
|
||||||
let parent_pipeline_info = self.pipelines.get(&pipeline_id).and_then(|source| source.parent_info);
|
let parent_pipeline_info = self.pipelines.get(&pipeline_id).and_then(|source| source.parent_info);
|
||||||
if let Some(_) = parent_pipeline_info {
|
if parent_pipeline_info.is_some() {
|
||||||
let root_pipeline_id = self.root_frame_id
|
let root_pipeline_id = self.root_frame_id
|
||||||
.and_then(|root_frame_id| self.frames.get(&root_frame_id))
|
.and_then(|root_frame_id| self.frames.get(&root_frame_id))
|
||||||
.map(|root_frame| root_frame.current.0);
|
.map(|root_frame| root_frame.current.0);
|
||||||
|
|
|
@ -501,6 +501,10 @@ impl UnprivilegedPipelineContent {
|
||||||
command.env("RUST_BACKTRACE", value);
|
command.env("RUST_BACKTRACE", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Ok(value) = env::var("RUST_LOG") {
|
||||||
|
command.env("RUST_LOG", value);
|
||||||
|
}
|
||||||
|
|
||||||
let profile = content_process_sandbox_profile();
|
let profile = content_process_sandbox_profile();
|
||||||
ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command)
|
ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command)
|
||||||
.expect("Failed to start sandboxed child process!"))
|
.expect("Failed to start sandboxed child process!"))
|
||||||
|
@ -515,6 +519,10 @@ impl UnprivilegedPipelineContent {
|
||||||
child_process.env("RUST_BACKTRACE", value);
|
child_process.env("RUST_BACKTRACE", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Ok(value) = env::var("RUST_LOG") {
|
||||||
|
child_process.env("RUST_LOG", value);
|
||||||
|
}
|
||||||
|
|
||||||
ChildProcess::Unsandboxed(child_process.spawn()
|
ChildProcess::Unsandboxed(child_process.spawn()
|
||||||
.expect("Failed to start unsandboxed child process!"))
|
.expect("Failed to start unsandboxed child process!"))
|
||||||
};
|
};
|
||||||
|
|
|
@ -379,8 +379,7 @@ impl<C> PaintThread<C> where C: PaintListener + Send + 'static {
|
||||||
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) {
|
||||||
thread::spawn_named(format!("PaintThread {:?}", id),
|
thread::spawn_named(format!("PaintThread {:?}", id), move || {
|
||||||
move || {
|
|
||||||
thread_state::initialize(thread_state::PAINT);
|
thread_state::initialize(thread_state::PAINT);
|
||||||
PipelineId::install(id);
|
PipelineId::install(id);
|
||||||
|
|
||||||
|
@ -425,9 +424,9 @@ impl<C> PaintThread<C> where C: PaintListener + Send + 'static {
|
||||||
let chrome_to_paint = &self.chrome_to_paint_port;
|
let chrome_to_paint = &self.chrome_to_paint_port;
|
||||||
select! {
|
select! {
|
||||||
msg = layout_to_paint.recv() =>
|
msg = layout_to_paint.recv() =>
|
||||||
Msg::FromLayout(msg.unwrap()),
|
Msg::FromLayout(msg.expect("expected message from layout")),
|
||||||
msg = chrome_to_paint.recv() =>
|
msg = chrome_to_paint.recv() =>
|
||||||
Msg::FromChrome(msg.unwrap())
|
Msg::FromChrome(msg.expect("expected message from chrome"))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2915,6 +2915,7 @@ impl DocumentProgressHandler {
|
||||||
// http://w3c.github.io/navigation-timing/#widl-PerformanceNavigationTiming-loadEventStart
|
// http://w3c.github.io/navigation-timing/#widl-PerformanceNavigationTiming-loadEventStart
|
||||||
update_with_current_time_ms(&document.load_event_start);
|
update_with_current_time_ms(&document.load_event_start);
|
||||||
|
|
||||||
|
debug!("About to dispatch load for {:?}", document.url());
|
||||||
let _ = wintarget.dispatch_event_with_target(document.upcast(), &event);
|
let _ = wintarget.dispatch_event_with_target(document.upcast(), &event);
|
||||||
|
|
||||||
// http://w3c.github.io/navigation-timing/#widl-PerformanceNavigationTiming-loadEventEnd
|
// http://w3c.github.io/navigation-timing/#widl-PerformanceNavigationTiming-loadEventEnd
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue