Skip to content

Commit

Permalink
Remove Traceable from browsercontext.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Oct 5, 2014
1 parent b908d5a commit 8de00ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/bindings/trace.rs
Expand Up @@ -180,9 +180,9 @@ impl<T: JSTraceable+Copy> JSTraceable for Cell<T> {
}
}

impl JSTraceable for Traceable<*mut JSObject> {
impl JSTraceable for *mut JSObject {
fn trace(&self, trc: *mut JSTracer) {
trace_object(trc, "object", **self);
trace_object(trc, "object", *self);
}
}

Expand Down
11 changes: 5 additions & 6 deletions components/script/dom/browsercontext.rs
Expand Up @@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use dom::bindings::js::{JS, JSRef, Temporary};
use dom::bindings::trace::Traceable;
use dom::bindings::utils::Reflectable;
use dom::document::Document;
use dom::window::Window;
Expand All @@ -20,15 +19,15 @@ use std::ptr;
pub struct BrowserContext {
history: Vec<SessionHistoryEntry>,
active_index: uint,
window_proxy: Traceable<*mut JSObject>,
window_proxy: *mut JSObject,
}

impl BrowserContext {
pub fn new(document: JSRef<Document>) -> BrowserContext {
let mut context = BrowserContext {
history: vec!(SessionHistoryEntry::new(document)),
active_index: 0,
window_proxy: Traceable::new(ptr::null_mut()),
window_proxy: ptr::null_mut(),
};
context.create_window_proxy();
context
Expand All @@ -44,8 +43,8 @@ impl BrowserContext {
}

pub fn window_proxy(&self) -> *mut JSObject {
assert!(self.window_proxy.deref().is_not_null());
*self.window_proxy
assert!(self.window_proxy.is_not_null());
self.window_proxy
}

fn create_window_proxy(&mut self) {
Expand All @@ -62,7 +61,7 @@ impl BrowserContext {
WrapperNew(cx, parent, *handler.deref())
});
assert!(wrapper.is_not_null());
self.window_proxy = Traceable::new(wrapper);
self.window_proxy = wrapper;
}
}

Expand Down

0 comments on commit 8de00ab

Please sign in to comment.