mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
Auto merge of #10534 - asajeffrey:reenable-check-no-unwrap, r=Manishearth
Re-enabled etc/ci/check_no_unwrap Got `etc/ci/check_no_unwrap.sh` to pass, and re-enabled it. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10534) <!-- Reviewable:end -->
This commit is contained in:
commit
a61fc5285f
3 changed files with 26 additions and 17 deletions
|
@ -14,6 +14,7 @@ matrix:
|
||||||
- ./mach build -d --verbose
|
- ./mach build -d --verbose
|
||||||
- ./mach test-unit
|
- ./mach test-unit
|
||||||
- ./mach test-compiletest
|
- ./mach test-compiletest
|
||||||
|
- bash etc/ci/check_no_unwrap.sh
|
||||||
- bash etc/ci/lockfile_changed.sh
|
- bash etc/ci/lockfile_changed.sh
|
||||||
- bash etc/ci/manifest_changed.sh
|
- bash etc/ci/manifest_changed.sh
|
||||||
cache:
|
cache:
|
||||||
|
|
|
@ -755,7 +755,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
if !self.pipeline_details.contains_key(&pipeline_id) {
|
if !self.pipeline_details.contains_key(&pipeline_id) {
|
||||||
self.pipeline_details.insert(pipeline_id, PipelineDetails::new());
|
self.pipeline_details.insert(pipeline_id, PipelineDetails::new());
|
||||||
}
|
}
|
||||||
self.pipeline_details.get_mut(&pipeline_id).unwrap()
|
self.pipeline_details.get_mut(&pipeline_id).expect("Insert then get failed!")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pipeline(&self, pipeline_id: PipelineId) -> Option<&CompositionPipeline> {
|
pub fn pipeline(&self, pipeline_id: PipelineId) -> Option<&CompositionPipeline> {
|
||||||
|
@ -2191,7 +2191,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
||||||
let src_slice = &orig_pixels[src_start .. src_start + stride];
|
let src_slice = &orig_pixels[src_start .. src_start + stride];
|
||||||
(&mut pixels[dst_start .. dst_start + stride]).clone_from_slice(&src_slice[..stride]);
|
(&mut pixels[dst_start .. dst_start + stride]).clone_from_slice(&src_slice[..stride]);
|
||||||
}
|
}
|
||||||
RgbImage::from_raw(width as u32, height as u32, pixels).unwrap()
|
RgbImage::from_raw(width as u32, height as u32, pixels).expect("Flipping image failed!")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn composite_if_necessary(&mut self, reason: CompositingReason) {
|
fn composite_if_necessary(&mut self, reason: CompositingReason) {
|
||||||
|
|
|
@ -461,25 +461,28 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
||||||
// avoiding this panic would require a mechanism for dealing
|
// avoiding this panic would require a mechanism for dealing
|
||||||
// with low-resource scenarios.
|
// with low-resource scenarios.
|
||||||
let (server, token) =
|
let (server, token) =
|
||||||
IpcOneShotServer::<IpcSender<UnprivilegedPipelineContent>>::new().unwrap();
|
IpcOneShotServer::<IpcSender<UnprivilegedPipelineContent>>::new()
|
||||||
|
.expect("Failed to create IPC one-shot server.");
|
||||||
|
|
||||||
// If there is a sandbox, use the `gaol` API to create the child process.
|
// If there is a sandbox, use the `gaol` API to create the child process.
|
||||||
let child_process = if opts::get().sandbox {
|
let child_process = if opts::get().sandbox {
|
||||||
let mut command = sandbox::Command::me().unwrap();
|
let mut command = sandbox::Command::me().expect("Failed to get current sandbox.");
|
||||||
command.arg("--content-process").arg(token);
|
command.arg("--content-process").arg(token);
|
||||||
let profile = sandboxing::content_process_sandbox_profile();
|
let profile = sandboxing::content_process_sandbox_profile();
|
||||||
ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command).expect(
|
ChildProcess::Sandboxed(Sandbox::new(profile).start(&mut command)
|
||||||
"Failed to start sandboxed child process!"))
|
.expect("Failed to start sandboxed child process!"))
|
||||||
} else {
|
} else {
|
||||||
let path_to_self = env::current_exe().unwrap();
|
let path_to_self = env::current_exe()
|
||||||
|
.expect("Failed to get current executor.");
|
||||||
let mut child_process = process::Command::new(path_to_self);
|
let mut child_process = process::Command::new(path_to_self);
|
||||||
child_process.arg("--content-process");
|
child_process.arg("--content-process");
|
||||||
child_process.arg(token);
|
child_process.arg(token);
|
||||||
ChildProcess::Unsandboxed(child_process.spawn().unwrap())
|
ChildProcess::Unsandboxed(child_process.spawn()
|
||||||
|
.expect("Failed to start unsandboxed child process!"))
|
||||||
};
|
};
|
||||||
|
|
||||||
self.child_processes.push(child_process);
|
self.child_processes.push(child_process);
|
||||||
let (_receiver, sender) = server.accept().unwrap();
|
let (_receiver, sender) = server.accept().expect("Server failed to accept.");
|
||||||
sender.send(unprivileged_pipeline_content)
|
sender.send(unprivileged_pipeline_content)
|
||||||
.unwrap_or_else(|_| self.handle_send_error(pipeline_id));
|
.unwrap_or_else(|_| self.handle_send_error(pipeline_id));
|
||||||
}
|
}
|
||||||
|
@ -832,7 +835,8 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
||||||
// It's quite difficult to make Servo exit cleanly if some threads have failed.
|
// It's quite difficult to make Servo exit cleanly if some threads have failed.
|
||||||
// Hard fail exists for test runners so we crash and that's good enough.
|
// Hard fail exists for test runners so we crash and that's good enough.
|
||||||
let mut stderr = io::stderr();
|
let mut stderr = io::stderr();
|
||||||
stderr.write_all("Pipeline failed in hard-fail mode. Crashing!\n".as_bytes()).unwrap();
|
stderr.write_all("Pipeline failed in hard-fail mode. Crashing!\n".as_bytes())
|
||||||
|
.expect("Failed to write to stderr!");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1618,7 +1622,7 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
||||||
// before we check whether the document is ready; otherwise,
|
// before we check whether the document is ready; otherwise,
|
||||||
// there's a race condition where a webfont has finished loading,
|
// there's a race condition where a webfont has finished loading,
|
||||||
// but hasn't yet notified the document.
|
// but hasn't yet notified the document.
|
||||||
let (sender, receiver) = ipc::channel().unwrap();
|
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
|
||||||
let msg = LayoutControlMsg::GetWebFontLoadState(sender);
|
let msg = LayoutControlMsg::GetWebFontLoadState(sender);
|
||||||
pipeline.layout_chan.0.send(msg)
|
pipeline.layout_chan.0.send(msg)
|
||||||
.unwrap_or_else(|e| debug!("Get web font failed ({})", e));
|
.unwrap_or_else(|e| debug!("Get web font failed ({})", e));
|
||||||
|
@ -1654,12 +1658,16 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
||||||
// epoch matches what the compositor has drawn. If they match
|
// epoch matches what the compositor has drawn. If they match
|
||||||
// (and script is idle) then this pipeline won't change again
|
// (and script is idle) then this pipeline won't change again
|
||||||
// and can be considered stable.
|
// and can be considered stable.
|
||||||
let (sender, receiver) = ipc::channel().unwrap();
|
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
|
||||||
let LayoutControlChan(ref layout_chan) = pipeline.layout_chan;
|
let LayoutControlChan(ref layout_chan) = pipeline.layout_chan;
|
||||||
layout_chan.send(LayoutControlMsg::GetCurrentEpoch(sender)).unwrap();
|
if let Err(e) = layout_chan.send(LayoutControlMsg::GetCurrentEpoch(sender)) {
|
||||||
let layout_thread_epoch = receiver.recv().unwrap();
|
warn!("Failed to send GetCurrentEpoch ({}).", e);
|
||||||
if layout_thread_epoch != *compositor_epoch {
|
}
|
||||||
|
match receiver.recv() {
|
||||||
|
Err(e) => warn!("Failed to receive current epoch ({}).", e),
|
||||||
|
Ok(layout_thread_epoch) => if layout_thread_epoch != *compositor_epoch {
|
||||||
return ReadyToSave::EpochMismatch;
|
return ReadyToSave::EpochMismatch;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
|
@ -1835,7 +1843,7 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
|
||||||
if let Some(root_frame_id) = self.root_frame_id {
|
if let Some(root_frame_id) = self.root_frame_id {
|
||||||
if let Some(frame_tree) = self.frame_to_sendable(root_frame_id) {
|
if let Some(frame_tree) = self.frame_to_sendable(root_frame_id) {
|
||||||
|
|
||||||
let (chan, port) = ipc::channel().unwrap();
|
let (chan, port) = ipc::channel().expect("Failed to create IPC channel!");
|
||||||
self.compositor_proxy.send(ToCompositorMsg::SetFrameTree(frame_tree,
|
self.compositor_proxy.send(ToCompositorMsg::SetFrameTree(frame_tree,
|
||||||
chan,
|
chan,
|
||||||
self.compositor_sender.clone()));
|
self.compositor_sender.clone()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue