diff options
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r-- | components/script_traits/lib.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 010ffe5b296..0b6bb4a3b36 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#![feature(int_uint)] + #![deny(unused_imports)] #![deny(unused_variables)] #![allow(missing_copy_implementations)] @@ -31,15 +33,17 @@ use servo_net::resource_task::ResourceTask; use servo_net::storage_task::StorageTask; use servo_util::smallvec::SmallVec1; use std::any::Any; +use std::sync::mpsc::{Sender, Receiver}; use geom::point::Point2D; use geom::rect::Rect; -use serialize::{Encodable, Encoder}; - /// The address of a node. Layout sends these back. They must be validated via /// `from_untrusted_node_address` before they can be used, because we do not trust layout. -pub type UntrustedNodeAddress = *const c_void; +#[allow(raw_pointer_derive)] +#[derive(Copy, Clone)] +pub struct UntrustedNodeAddress(pub *const c_void); +unsafe impl Send for UntrustedNodeAddress {} pub struct NewLayoutInfo { pub old_pipeline_id: PipelineId, @@ -70,6 +74,9 @@ pub enum ConstellationControlMsg { GetTitle(PipelineId), } +unsafe impl Send for ConstellationControlMsg { +} + /// Events from the compositor that the script task needs to know about pub enum CompositorEvent { ResizeEvent(WindowSizeData), @@ -86,15 +93,9 @@ pub enum CompositorEvent { pub struct OpaqueScriptLayoutChannel(pub (Box<Any+Send>, Box<Any+Send>)); /// Encapsulates external communication with the script task. -#[deriving(Clone)] +#[derive(Clone)] pub struct ScriptControlChan(pub Sender<ConstellationControlMsg>); -impl<S: Encoder<E>, E> Encodable<S, E> for ScriptControlChan { - fn encode(&self, _s: &mut S) -> Result<(), E> { - Ok(()) - } -} - pub trait ScriptTaskFactory { fn create<C>(_phantom: Option<&mut Self>, id: PipelineId, |