Skip to content

Commit

Permalink
Simple privatizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ttaubert committed Oct 13, 2014
1 parent 5b72087 commit acd98a7
Show file tree
Hide file tree
Showing 36 changed files with 59 additions and 22 deletions.
1 change: 1 addition & 0 deletions components/script/dom/blob.rs
Expand Up @@ -17,6 +17,7 @@ pub enum BlobType {

#[jstraceable]
#[must_root]
#[privatize]
pub struct Blob {
reflector_: Reflector,
type_: BlobType
Expand Down
2 changes: 2 additions & 0 deletions components/script/dom/browsercontext.rs
Expand Up @@ -15,6 +15,7 @@ use std::ptr;

#[allow(raw_pointer_deriving)]
#[jstraceable]
#[privatize]
pub struct BrowserContext {
history: Vec<SessionHistoryEntry>,
active_index: uint,
Expand Down Expand Up @@ -66,6 +67,7 @@ impl BrowserContext {

#[jstraceable]
#[must_root]
#[privatize]
pub struct SessionHistoryEntry {
document: JS<Document>,
children: Vec<BrowserContext>
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/canvasrenderingcontext2d.rs
Expand Up @@ -17,6 +17,7 @@ use canvas::canvas_render_task::{CanvasMsg, CanvasRenderTask, ClearRect, Close,

#[jstraceable]
#[must_root]
#[privatize]
pub struct CanvasRenderingContext2D {
reflector_: Reflector,
global: GlobalField,
Expand Down
3 changes: 2 additions & 1 deletion components/script/dom/console.rs
Expand Up @@ -11,8 +11,9 @@ use servo_util::str::DOMString;

#[jstraceable]
#[must_root]
#[privatize]
pub struct Console {
pub reflector_: Reflector
reflector_: Reflector
}

impl Console {
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/customevent.rs
Expand Up @@ -19,6 +19,7 @@ use std::cell::Cell;

#[jstraceable]
#[must_root]
#[privatize]
pub struct CustomEvent {
event: Event,
detail: Cell<JSVal>,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/dedicatedworkerglobalscope.rs
Expand Up @@ -37,6 +37,7 @@ use url::Url;

#[jstraceable]
#[must_root]
#[privatize]
pub struct DedicatedWorkerGlobalScope {
workerglobalscope: WorkerGlobalScope,
receiver: Receiver<ScriptMsg>,
Expand Down
3 changes: 2 additions & 1 deletion components/script/dom/documentfragment.rs
Expand Up @@ -20,8 +20,9 @@ use servo_util::str::DOMString;

#[jstraceable]
#[must_root]
#[privatize]
pub struct DocumentFragment {
pub node: Node,
node: Node,
}

impl DocumentFragmentDerived for EventTarget {
Expand Down
5 changes: 3 additions & 2 deletions components/script/dom/domexception.rs
Expand Up @@ -62,9 +62,10 @@ impl DOMErrorName {

#[jstraceable]
#[must_root]
#[privatize]
pub struct DOMException {
pub code: DOMErrorName,
pub reflector_: Reflector
code: DOMErrorName,
reflector_: Reflector
}

impl DOMException {
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/domimplementation.rs
Expand Up @@ -24,6 +24,7 @@ use servo_util::str::DOMString;

#[jstraceable]
#[must_root]
#[privatize]
pub struct DOMImplementation {
document: JS<Document>,
reflector_: Reflector,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/domparser.rs
Expand Up @@ -16,6 +16,7 @@ use servo_util::str::DOMString;

#[jstraceable]
#[must_root]
#[privatize]
pub struct DOMParser {
window: JS<Window>, //XXXjdm Document instead?
reflector_: Reflector
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/domrect.rs
Expand Up @@ -12,6 +12,7 @@ use servo_util::geometry::Au;

#[jstraceable]
#[must_root]
#[privatize]
pub struct DOMRect {
reflector_: Reflector,
top: f32,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/domrectlist.rs
Expand Up @@ -12,6 +12,7 @@ use dom::window::Window;

#[jstraceable]
#[must_root]
#[privatize]
pub struct DOMRectList {
reflector_: Reflector,
rects: Vec<JS<DOMRect>>,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/domtokenlist.rs
Expand Up @@ -17,6 +17,7 @@ use string_cache::Atom;

#[jstraceable]
#[must_root]
#[privatize]
pub struct DOMTokenList {
reflector_: Reflector,
element: JS<Element>,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/formdata.rs
Expand Up @@ -27,6 +27,7 @@ pub enum FormDatum {

#[jstraceable]
#[must_root]
#[privatize]
pub struct FormData {
data: RefCell<HashMap<DOMString, Vec<FormDatum>>>,
reflector_: Reflector,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/htmlcollection.rs
Expand Up @@ -31,6 +31,7 @@ pub enum CollectionTypeId {

#[jstraceable]
#[must_root]
#[privatize]
pub struct HTMLCollection {
collection: CollectionTypeId,
reflector_: Reflector,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/location.rs
Expand Up @@ -17,6 +17,7 @@ use std::rc::Rc;

#[jstraceable]
#[must_root]
#[privatize]
pub struct Location {
reflector_: Reflector, //XXXjdm cycle: window->Location->window
page: Rc<Page>,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/messageevent.rs
Expand Up @@ -20,6 +20,7 @@ use js::jsval::JSVal;

#[jstraceable]
#[must_root]
#[privatize]
pub struct MessageEvent {
event: Event,
data: JSVal,
Expand Down
23 changes: 12 additions & 11 deletions components/script/dom/mouseevent.rs
Expand Up @@ -21,18 +21,19 @@ use std::default::Default;

#[jstraceable]
#[must_root]
#[privatize]
pub struct MouseEvent {
pub mouseevent: UIEvent,
pub screen_x: Cell<i32>,
pub screen_y: Cell<i32>,
pub client_x: Cell<i32>,
pub client_y: Cell<i32>,
pub ctrl_key: Cell<bool>,
pub shift_key: Cell<bool>,
pub alt_key: Cell<bool>,
pub meta_key: Cell<bool>,
pub button: Cell<i16>,
pub related_target: MutNullableJS<EventTarget>
mouseevent: UIEvent,
screen_x: Cell<i32>,
screen_y: Cell<i32>,
client_x: Cell<i32>,
client_y: Cell<i32>,
ctrl_key: Cell<bool>,
shift_key: Cell<bool>,
alt_key: Cell<bool>,
meta_key: Cell<bool>,
button: Cell<i16>,
related_target: MutNullableJS<EventTarget>
}

impl MouseEventDerived for Event {
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/namednodemap.rs
Expand Up @@ -13,6 +13,7 @@ use dom::window::Window;

#[jstraceable]
#[must_root]
#[privatize]
pub struct NamedNodeMap {
reflector_: Reflector,
owner: JS<Element>,
Expand Down
3 changes: 2 additions & 1 deletion components/script/dom/navigator.rs
Expand Up @@ -13,8 +13,9 @@ use servo_util::str::DOMString;

#[jstraceable]
#[must_root]
#[privatize]
pub struct Navigator {
pub reflector_: Reflector //XXXjdm cycle: window->navigator->window
reflector_: Reflector //XXXjdm cycle: window->navigator->window
}

impl Navigator {
Expand Down
3 changes: 2 additions & 1 deletion components/script/dom/nodeiterator.rs
Expand Up @@ -10,8 +10,9 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};

#[jstraceable]
#[must_root]
#[privatize]
pub struct NodeIterator {
pub reflector_: Reflector
reflector_: Reflector
}

impl NodeIterator {
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/nodelist.rs
Expand Up @@ -19,6 +19,7 @@ pub enum NodeListType {

#[jstraceable]
#[must_root]
#[privatize]
pub struct NodeList {
list_type: NodeListType,
reflector_: Reflector,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/performance.rs
Expand Up @@ -15,6 +15,7 @@ pub type DOMHighResTimeStamp = f64;

#[jstraceable]
#[must_root]
#[privatize]
pub struct Performance {
reflector_: Reflector,
timing: JS<PerformanceTiming>,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/performancetiming.rs
Expand Up @@ -11,6 +11,7 @@ use dom::window::Window;

#[jstraceable]
#[must_root]
#[privatize]
pub struct PerformanceTiming {
reflector_: Reflector,
navigationStart: u64,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/progressevent.rs
Expand Up @@ -15,6 +15,7 @@ use servo_util::str::DOMString;

#[jstraceable]
#[must_root]
#[privatize]
pub struct ProgressEvent {
event: Event,
length_computable: bool,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/range.rs
Expand Up @@ -13,6 +13,7 @@ use dom::document::Document;

#[jstraceable]
#[must_root]
#[privatize]
pub struct Range {
reflector_: Reflector
}
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/screen.rs
Expand Up @@ -11,6 +11,7 @@ use dom::window::Window;

#[jstraceable]
#[must_root]
#[privatize]
pub struct Screen {
reflector_: Reflector,
}
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/testbinding.rs
Expand Up @@ -20,6 +20,7 @@ use js::jsval::{JSVal, NullValue};

#[jstraceable]
#[must_root]
#[privatize]
pub struct TestBinding {
reflector: Reflector,
global: GlobalField,
Expand Down
11 changes: 6 additions & 5 deletions components/script/dom/treewalker.rs
Expand Up @@ -23,12 +23,13 @@ use std::cell::Cell;
// http://dom.spec.whatwg.org/#interface-treewalker
#[jstraceable]
#[must_root]
#[privatize]
pub struct TreeWalker {
pub reflector_: Reflector,
pub root_node: JS<Node>,
pub current_node: Cell<JS<Node>>,
pub what_to_show: u32,
pub filter: Filter
reflector_: Reflector,
root_node: JS<Node>,
current_node: Cell<JS<Node>>,
what_to_show: u32,
filter: Filter
}

impl TreeWalker {
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/urlsearchparams.rs
Expand Up @@ -22,6 +22,7 @@ use std::ascii::OwnedStrAsciiExt;

#[jstraceable]
#[must_root]
#[privatize]
pub struct URLSearchParams {
data: RefCell<HashMap<DOMString, Vec<DOMString>>>,
reflector_: Reflector,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/validitystate.rs
Expand Up @@ -10,6 +10,7 @@ use dom::window::Window;

#[jstraceable]
#[must_root]
#[privatize]
pub struct ValidityState {
reflector_: Reflector,
state: u8,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/worker.rs
Expand Up @@ -33,6 +33,7 @@ untraceable!(TrustedWorkerAddress)

#[jstraceable]
#[must_root]
#[privatize]
pub struct Worker {
eventtarget: EventTarget,
refcount: Cell<uint>,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/workerlocation.rs
Expand Up @@ -16,6 +16,7 @@ use url::Url;

#[jstraceable]
#[must_root]
#[privatize]
pub struct WorkerLocation {
reflector_: Reflector,
url: Url,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/workernavigator.rs
Expand Up @@ -13,6 +13,7 @@ use servo_util::str::DOMString;

#[jstraceable]
#[must_root]
#[privatize]
pub struct WorkerNavigator {
reflector_: Reflector,
}
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/xmlhttprequest.rs
Expand Up @@ -104,6 +104,7 @@ enum SyncOrAsync<'a> {

#[jstraceable]
#[must_root]
#[privatize]
pub struct XMLHttpRequest {
eventtarget: XMLHttpRequestEventTarget,
ready_state: Cell<XMLHttpRequestState>,
Expand Down
1 change: 1 addition & 0 deletions components/script/dom/xmlhttprequestupload.rs
Expand Up @@ -13,6 +13,7 @@ use dom::xmlhttprequesteventtarget::XMLHttpRequestEventTarget;

#[jstraceable]
#[must_root]
#[privatize]
pub struct XMLHttpRequestUpload {
eventtarget: XMLHttpRequestEventTarget
}
Expand Down

0 comments on commit acd98a7

Please sign in to comment.