mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update crossbeam-channel to 0.3
This commit is contained in:
parent
76195e0779
commit
9a7eeb349a
74 changed files with 303 additions and 521 deletions
|
@ -23,6 +23,7 @@ use crate::dom::worklet::WorkletExecutor;
|
|||
use crate::dom::workletglobalscope::WorkletGlobalScope;
|
||||
use crate::dom::workletglobalscope::WorkletGlobalScopeInit;
|
||||
use crate::dom::workletglobalscope::WorkletTask;
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::TypedScale;
|
||||
use euclid::TypedSize2D;
|
||||
|
@ -49,8 +50,6 @@ use profile_traits::ipc;
|
|||
use script_traits::Painter;
|
||||
use script_traits::{DrawAPaintImageResult, PaintWorkletError};
|
||||
use servo_atoms::Atom;
|
||||
use servo_channel::base_channel;
|
||||
use servo_channel::{channel, Sender};
|
||||
use servo_config::prefs::PREFS;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::Cell;
|
||||
|
@ -426,7 +425,7 @@ impl PaintWorkletGlobalScope {
|
|||
arguments: Vec<String>,
|
||||
) -> Result<DrawAPaintImageResult, PaintWorkletError> {
|
||||
let name = self.name.clone();
|
||||
let (sender, receiver) = channel();
|
||||
let (sender, receiver) = unbounded();
|
||||
let task = PaintWorkletTask::DrawAPaintImage(
|
||||
name,
|
||||
size,
|
||||
|
@ -445,12 +444,9 @@ impl PaintWorkletGlobalScope {
|
|||
.as_u64()
|
||||
.unwrap_or(10u64);
|
||||
|
||||
select! {
|
||||
recv(base_channel::after(Duration::from_millis(timeout))) => {
|
||||
Err(PaintWorkletError::Timeout)
|
||||
}
|
||||
recv(receiver.select(), msg) => msg.ok_or(PaintWorkletError::Timeout)
|
||||
}
|
||||
receiver
|
||||
.recv_timeout(Duration::from_millis(timeout))
|
||||
.map_err(|e| PaintWorkletError::from(e))
|
||||
}
|
||||
}
|
||||
Box::new(WorkletPainter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue