mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #8393 - rnestler:fix_8384, r=frewsxcv
Use while let{} instead of loop{match{}} This fixes #8384 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8393) <!-- Reviewable:end -->
This commit is contained in:
commit
1979d0a2e6
2 changed files with 8 additions and 18 deletions
|
@ -2125,16 +2125,11 @@ fn find_layer_with_pipeline_and_layer_id_for_layer(layer: Rc<Layer<CompositorDat
|
||||||
impl<Window> CompositorEventListener for IOCompositor<Window> where Window: WindowMethods {
|
impl<Window> CompositorEventListener for IOCompositor<Window> where Window: WindowMethods {
|
||||||
fn handle_events(&mut self, messages: Vec<WindowEvent>) -> bool {
|
fn handle_events(&mut self, messages: Vec<WindowEvent>) -> bool {
|
||||||
// Check for new messages coming from the other tasks in the system.
|
// Check for new messages coming from the other tasks in the system.
|
||||||
loop {
|
while let Some(msg) = self.port.try_recv_compositor_msg() {
|
||||||
match self.port.try_recv_compositor_msg() {
|
|
||||||
None => break,
|
|
||||||
Some(msg) => {
|
|
||||||
if !self.handle_browser_message(msg) {
|
if !self.handle_browser_message(msg) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.shutdown_state == ShutdownState::FinishedShuttingDown {
|
if self.shutdown_state == ShutdownState::FinishedShuttingDown {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -54,17 +54,12 @@ impl ScrollingTimerProxy {
|
||||||
|
|
||||||
impl ScrollingTimer {
|
impl ScrollingTimer {
|
||||||
pub fn run(&mut self) {
|
pub fn run(&mut self) {
|
||||||
loop {
|
while let Ok(ToScrollingTimerMsg::ScrollEventProcessedMsg(timestamp)) = self.receiver.recv() {
|
||||||
match self.receiver.recv() {
|
|
||||||
Ok(ToScrollingTimerMsg::ScrollEventProcessedMsg(timestamp)) => {
|
|
||||||
let target = timestamp as i64 + TIMEOUT;
|
let target = timestamp as i64 + TIMEOUT;
|
||||||
let delta_ns = target - (time::precise_time_ns() as i64);
|
let delta_ns = target - (time::precise_time_ns() as i64);
|
||||||
sleep_ms((delta_ns / 1000000) as u32);
|
sleep_ms((delta_ns / 1000000) as u32);
|
||||||
self.compositor_proxy.send(Msg::ScrollTimeout(timestamp));
|
self.compositor_proxy.send(Msg::ScrollTimeout(timestamp));
|
||||||
}
|
}
|
||||||
Ok(ToScrollingTimerMsg::ExitMsg) | Err(_) => break,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue