mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
parent
4848e37e2e
commit
1dc0d61c3c
12 changed files with 64 additions and 97 deletions
|
@ -148,7 +148,7 @@ pub struct Constellation<LTF, STF> {
|
|||
/// A list of in-process senders to `WebGLPaintTask`s.
|
||||
webgl_paint_tasks: Vec<Sender<CanvasMsg>>,
|
||||
|
||||
scheduler_chan: Sender<TimerEventRequest>,
|
||||
scheduler_chan: IpcSender<TimerEventRequest>,
|
||||
}
|
||||
|
||||
/// State needed to construct a constellation.
|
||||
|
|
|
@ -68,6 +68,9 @@ pub struct CompositionPipeline {
|
|||
}
|
||||
|
||||
/// Initial setup data needed to construct a pipeline.
|
||||
///
|
||||
/// *DO NOT* add any Senders to this unless you absolutely know what you're doing, or pcwalton will
|
||||
/// have to rewrite your code. Use IPC senders instead.
|
||||
pub struct InitialPipelineState {
|
||||
/// The ID of the pipeline to create.
|
||||
pub id: PipelineId,
|
||||
|
@ -77,7 +80,7 @@ pub struct InitialPipelineState {
|
|||
/// A channel to the associated constellation.
|
||||
pub constellation_chan: ConstellationChan,
|
||||
/// A channel to schedule timer events.
|
||||
pub scheduler_chan: Sender<TimerEventRequest>,
|
||||
pub scheduler_chan: IpcSender<TimerEventRequest>,
|
||||
/// A channel to the compositor.
|
||||
pub compositor_proxy: Box<CompositorProxy + 'static + Send>,
|
||||
/// A channel to the developer tools, if applicable.
|
||||
|
@ -315,7 +318,7 @@ pub struct PipelineContent {
|
|||
id: PipelineId,
|
||||
parent_info: Option<(PipelineId, SubpageId)>,
|
||||
constellation_chan: ConstellationChan,
|
||||
scheduler_chan: Sender<TimerEventRequest>,
|
||||
scheduler_chan: IpcSender<TimerEventRequest>,
|
||||
compositor_proxy: Box<CompositorProxy + Send + 'static>,
|
||||
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
|
||||
image_cache_task: ImageCacheTask,
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use euclid::length::Length;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use num::traits::Saturating;
|
||||
use script_traits::{MsDuration, NsDuration, precise_time_ms, precise_time_ns};
|
||||
use script_traits::{TimerEvent, TimerEventRequest};
|
||||
|
@ -11,7 +13,7 @@ use std::cmp::{self, Ord};
|
|||
use std::collections::BinaryHeap;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{self, AtomicBool};
|
||||
use std::sync::mpsc::{channel, Receiver, Select, Sender};
|
||||
use std::sync::mpsc::{channel, Receiver, Select};
|
||||
use std::thread::{self, spawn, Thread};
|
||||
use util::task::spawn_named;
|
||||
|
||||
|
@ -107,11 +109,11 @@ enum Task {
|
|||
}
|
||||
|
||||
impl TimerScheduler {
|
||||
pub fn start() -> Sender<TimerEventRequest> {
|
||||
let (chan, port) = channel();
|
||||
pub fn start() -> IpcSender<TimerEventRequest> {
|
||||
let (chan, port) = ipc::channel().unwrap();
|
||||
|
||||
let timer_scheduler = TimerScheduler {
|
||||
port: port,
|
||||
port: ROUTER.route_ipc_receiver_to_new_mpsc_receiver(port),
|
||||
|
||||
scheduled_events: RefCell::new(BinaryHeap::new()),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue