Change #[privatize] into #[derive(DenyPublicFields)]

This commit is contained in:
Anthony Ramine 2017-02-14 17:35:39 +01:00
parent 19c645ff68
commit 8bcf36b9a5
16 changed files with 69 additions and 65 deletions

View file

@ -35,6 +35,7 @@ canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0"
cookie = {version = "0.2.5", features = ["serialize-rustc"]}
cssparser = {version = "0.8", features = ["heap_size", "serde-serialization"]}
deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"}
domobject_derive = {path = "../domobject_derive"}
encoding = "0.2"

View file

@ -48,10 +48,8 @@ pub trait Iterable {
/// An iterator over the iterable entries of a given DOM interface.
//FIXME: #12811 prevents dom_struct with type parameters
//#[dom_struct]
#[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
#[must_root]
#[privatize]
#[derive(JSTraceable)]
#[derive(HeapSizeOf)]
pub struct IterableIterator<T: DomObject + JSTraceable + Iterable> {
reflector: Reflector,
iterable: JS<T>,

View file

@ -220,8 +220,7 @@ impl CompiledEventListener {
}
}
#[derive(JSTraceable, Clone, PartialEq, HeapSizeOf)]
#[privatize]
#[derive(Clone, DenyPublicFields, HeapSizeOf, JSTraceable, PartialEq)]
/// A listener in a collection of event listeners.
struct EventListenerEntry {
phase: ListenerPhase,

View file

@ -929,10 +929,8 @@ impl RangeMethods for Range {
}
}
#[derive(JSTraceable)]
#[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
#[must_root]
#[privatize]
#[derive(HeapSizeOf)]
pub struct BoundaryPoint {
node: MutJS<Node>,
offset: Cell<u32>,

View file

@ -38,6 +38,8 @@ extern crate cookie as cookie_rs;
extern crate core;
#[macro_use]
extern crate cssparser;
#[macro_use]
extern crate deny_public_fields;
extern crate devtools_traits;
#[macro_use]
extern crate domobject_derive;

View file

@ -28,8 +28,7 @@ use std::rc::Rc;
#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)]
pub struct OneshotTimerHandle(i32);
#[derive(JSTraceable, HeapSizeOf)]
#[privatize]
#[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
pub struct OneshotTimers {
js_timers: JsTimers,
#[ignore_heap_size_of = "Defined in std"]
@ -53,8 +52,7 @@ pub struct OneshotTimers {
expected_event_id: Cell<TimerEventId>,
}
#[derive(JSTraceable, HeapSizeOf)]
#[privatize]
#[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
struct OneshotTimer {
handle: OneshotTimerHandle,
source: TimerSource,
@ -302,8 +300,7 @@ impl OneshotTimers {
#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord)]
pub struct JsTimerHandle(i32);
#[derive(JSTraceable, HeapSizeOf)]
#[privatize]
#[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
pub struct JsTimers {
next_timer_handle: Cell<JsTimerHandle>,
active_timers: DOMRefCell<HashMap<JsTimerHandle, JsTimerEntry>>,