Simple privatizations

This commit is contained in:
Tim Taubert 2014-10-12 19:06:56 +02:00
parent 5b72087944
commit acd98a73a4
36 changed files with 59 additions and 22 deletions

View file

@ -17,6 +17,7 @@ pub enum BlobType {
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Blob { pub struct Blob {
reflector_: Reflector, reflector_: Reflector,
type_: BlobType type_: BlobType

View file

@ -15,6 +15,7 @@ use std::ptr;
#[allow(raw_pointer_deriving)] #[allow(raw_pointer_deriving)]
#[jstraceable] #[jstraceable]
#[privatize]
pub struct BrowserContext { pub struct BrowserContext {
history: Vec<SessionHistoryEntry>, history: Vec<SessionHistoryEntry>,
active_index: uint, active_index: uint,
@ -66,6 +67,7 @@ impl BrowserContext {
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct SessionHistoryEntry { pub struct SessionHistoryEntry {
document: JS<Document>, document: JS<Document>,
children: Vec<BrowserContext> children: Vec<BrowserContext>

View file

@ -17,6 +17,7 @@ use canvas::canvas_render_task::{CanvasMsg, CanvasRenderTask, ClearRect, Close,
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct CanvasRenderingContext2D { pub struct CanvasRenderingContext2D {
reflector_: Reflector, reflector_: Reflector,
global: GlobalField, global: GlobalField,

View file

@ -11,8 +11,9 @@ use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Console { pub struct Console {
pub reflector_: Reflector reflector_: Reflector
} }
impl Console { impl Console {

View file

@ -19,6 +19,7 @@ use std::cell::Cell;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct CustomEvent { pub struct CustomEvent {
event: Event, event: Event,
detail: Cell<JSVal>, detail: Cell<JSVal>,

View file

@ -37,6 +37,7 @@ use url::Url;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DedicatedWorkerGlobalScope { pub struct DedicatedWorkerGlobalScope {
workerglobalscope: WorkerGlobalScope, workerglobalscope: WorkerGlobalScope,
receiver: Receiver<ScriptMsg>, receiver: Receiver<ScriptMsg>,

View file

@ -20,8 +20,9 @@ use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DocumentFragment { pub struct DocumentFragment {
pub node: Node, node: Node,
} }
impl DocumentFragmentDerived for EventTarget { impl DocumentFragmentDerived for EventTarget {

View file

@ -62,9 +62,10 @@ impl DOMErrorName {
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DOMException { pub struct DOMException {
pub code: DOMErrorName, code: DOMErrorName,
pub reflector_: Reflector reflector_: Reflector
} }
impl DOMException { impl DOMException {

View file

@ -24,6 +24,7 @@ use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DOMImplementation { pub struct DOMImplementation {
document: JS<Document>, document: JS<Document>,
reflector_: Reflector, reflector_: Reflector,

View file

@ -16,6 +16,7 @@ use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DOMParser { pub struct DOMParser {
window: JS<Window>, //XXXjdm Document instead? window: JS<Window>, //XXXjdm Document instead?
reflector_: Reflector reflector_: Reflector

View file

@ -12,6 +12,7 @@ use servo_util::geometry::Au;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DOMRect { pub struct DOMRect {
reflector_: Reflector, reflector_: Reflector,
top: f32, top: f32,

View file

@ -12,6 +12,7 @@ use dom::window::Window;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DOMRectList { pub struct DOMRectList {
reflector_: Reflector, reflector_: Reflector,
rects: Vec<JS<DOMRect>>, rects: Vec<JS<DOMRect>>,

View file

@ -17,6 +17,7 @@ use string_cache::Atom;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct DOMTokenList { pub struct DOMTokenList {
reflector_: Reflector, reflector_: Reflector,
element: JS<Element>, element: JS<Element>,

View file

@ -27,6 +27,7 @@ pub enum FormDatum {
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct FormData { pub struct FormData {
data: RefCell<HashMap<DOMString, Vec<FormDatum>>>, data: RefCell<HashMap<DOMString, Vec<FormDatum>>>,
reflector_: Reflector, reflector_: Reflector,

View file

@ -31,6 +31,7 @@ pub enum CollectionTypeId {
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct HTMLCollection { pub struct HTMLCollection {
collection: CollectionTypeId, collection: CollectionTypeId,
reflector_: Reflector, reflector_: Reflector,

View file

@ -17,6 +17,7 @@ use std::rc::Rc;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Location { pub struct Location {
reflector_: Reflector, //XXXjdm cycle: window->Location->window reflector_: Reflector, //XXXjdm cycle: window->Location->window
page: Rc<Page>, page: Rc<Page>,

View file

@ -20,6 +20,7 @@ use js::jsval::JSVal;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct MessageEvent { pub struct MessageEvent {
event: Event, event: Event,
data: JSVal, data: JSVal,

View file

@ -21,18 +21,19 @@ use std::default::Default;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct MouseEvent { pub struct MouseEvent {
pub mouseevent: UIEvent, mouseevent: UIEvent,
pub screen_x: Cell<i32>, screen_x: Cell<i32>,
pub screen_y: Cell<i32>, screen_y: Cell<i32>,
pub client_x: Cell<i32>, client_x: Cell<i32>,
pub client_y: Cell<i32>, client_y: Cell<i32>,
pub ctrl_key: Cell<bool>, ctrl_key: Cell<bool>,
pub shift_key: Cell<bool>, shift_key: Cell<bool>,
pub alt_key: Cell<bool>, alt_key: Cell<bool>,
pub meta_key: Cell<bool>, meta_key: Cell<bool>,
pub button: Cell<i16>, button: Cell<i16>,
pub related_target: MutNullableJS<EventTarget> related_target: MutNullableJS<EventTarget>
} }
impl MouseEventDerived for Event { impl MouseEventDerived for Event {

View file

@ -13,6 +13,7 @@ use dom::window::Window;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct NamedNodeMap { pub struct NamedNodeMap {
reflector_: Reflector, reflector_: Reflector,
owner: JS<Element>, owner: JS<Element>,

View file

@ -13,8 +13,9 @@ use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Navigator { pub struct Navigator {
pub reflector_: Reflector //XXXjdm cycle: window->navigator->window reflector_: Reflector //XXXjdm cycle: window->navigator->window
} }
impl Navigator { impl Navigator {

View file

@ -10,8 +10,9 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct NodeIterator { pub struct NodeIterator {
pub reflector_: Reflector reflector_: Reflector
} }
impl NodeIterator { impl NodeIterator {

View file

@ -19,6 +19,7 @@ pub enum NodeListType {
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct NodeList { pub struct NodeList {
list_type: NodeListType, list_type: NodeListType,
reflector_: Reflector, reflector_: Reflector,

View file

@ -15,6 +15,7 @@ pub type DOMHighResTimeStamp = f64;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Performance { pub struct Performance {
reflector_: Reflector, reflector_: Reflector,
timing: JS<PerformanceTiming>, timing: JS<PerformanceTiming>,

View file

@ -11,6 +11,7 @@ use dom::window::Window;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct PerformanceTiming { pub struct PerformanceTiming {
reflector_: Reflector, reflector_: Reflector,
navigationStart: u64, navigationStart: u64,

View file

@ -15,6 +15,7 @@ use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct ProgressEvent { pub struct ProgressEvent {
event: Event, event: Event,
length_computable: bool, length_computable: bool,

View file

@ -13,6 +13,7 @@ use dom::document::Document;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Range { pub struct Range {
reflector_: Reflector reflector_: Reflector
} }

View file

@ -11,6 +11,7 @@ use dom::window::Window;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Screen { pub struct Screen {
reflector_: Reflector, reflector_: Reflector,
} }

View file

@ -20,6 +20,7 @@ use js::jsval::{JSVal, NullValue};
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct TestBinding { pub struct TestBinding {
reflector: Reflector, reflector: Reflector,
global: GlobalField, global: GlobalField,

View file

@ -23,12 +23,13 @@ use std::cell::Cell;
// http://dom.spec.whatwg.org/#interface-treewalker // http://dom.spec.whatwg.org/#interface-treewalker
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct TreeWalker { pub struct TreeWalker {
pub reflector_: Reflector, reflector_: Reflector,
pub root_node: JS<Node>, root_node: JS<Node>,
pub current_node: Cell<JS<Node>>, current_node: Cell<JS<Node>>,
pub what_to_show: u32, what_to_show: u32,
pub filter: Filter filter: Filter
} }
impl TreeWalker { impl TreeWalker {

View file

@ -22,6 +22,7 @@ use std::ascii::OwnedStrAsciiExt;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct URLSearchParams { pub struct URLSearchParams {
data: RefCell<HashMap<DOMString, Vec<DOMString>>>, data: RefCell<HashMap<DOMString, Vec<DOMString>>>,
reflector_: Reflector, reflector_: Reflector,

View file

@ -10,6 +10,7 @@ use dom::window::Window;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct ValidityState { pub struct ValidityState {
reflector_: Reflector, reflector_: Reflector,
state: u8, state: u8,

View file

@ -33,6 +33,7 @@ untraceable!(TrustedWorkerAddress)
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct Worker { pub struct Worker {
eventtarget: EventTarget, eventtarget: EventTarget,
refcount: Cell<uint>, refcount: Cell<uint>,

View file

@ -16,6 +16,7 @@ use url::Url;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct WorkerLocation { pub struct WorkerLocation {
reflector_: Reflector, reflector_: Reflector,
url: Url, url: Url,

View file

@ -13,6 +13,7 @@ use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct WorkerNavigator { pub struct WorkerNavigator {
reflector_: Reflector, reflector_: Reflector,
} }

View file

@ -104,6 +104,7 @@ enum SyncOrAsync<'a> {
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct XMLHttpRequest { pub struct XMLHttpRequest {
eventtarget: XMLHttpRequestEventTarget, eventtarget: XMLHttpRequestEventTarget,
ready_state: Cell<XMLHttpRequestState>, ready_state: Cell<XMLHttpRequestState>,

View file

@ -13,6 +13,7 @@ use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
#[privatize]
pub struct XMLHttpRequestUpload { pub struct XMLHttpRequestUpload {
eventtarget: XMLHttpRequestEventTarget eventtarget: XMLHttpRequestEventTarget
} }