aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-03-31 18:41:28 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-05-03 14:18:30 -0400
commitd7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1 (patch)
treeefd1e7f7ec1dd30467c2a67306e1a639837abead /src/components/script/dom/testbinding.rs
parentffdc3f5b32a345b88eed774848924e862d47c093 (diff)
downloadservo-d7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1.tar.gz
servo-d7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1.zip
Implement safe rooting strategy via Unrooted, Root, JSRef, and JS.
Diffstat (limited to 'src/components/script/dom/testbinding.rs')
-rw-r--r--src/components/script/dom/testbinding.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/script/dom/testbinding.rs b/src/components/script/dom/testbinding.rs
index e05cec800bb..76bb587b134 100644
--- a/src/components/script/dom/testbinding.rs
+++ b/src/components/script/dom/testbinding.rs
@@ -2,7 +2,7 @@
* 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/. */
-use dom::bindings::js::{JS, JSRef, RootCollection};
+use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted};
use dom::bindings::codegen::BindingDeclarations::TestBindingBinding;
use dom::bindings::codegen::UnionTypes::HTMLElementOrLong;
use self::TestBindingBinding::TestEnum;
@@ -51,10 +51,10 @@ impl TestBinding {
pub fn SetByteStringAttribute(&self, _: ByteString) {}
pub fn EnumAttribute(&self) -> TestEnum { _empty }
pub fn SetEnumAttribute(&self, _: TestEnum) {}
- pub fn InterfaceAttribute(&self) -> JS<Blob> {
+ pub fn InterfaceAttribute(&self) -> Unrooted<Blob> {
let roots = RootCollection::new();
let window = self.window.root(&roots);
- Blob::new(&window.root_ref())
+ Blob::new(&*window)
}
pub fn SetInterfaceAttribute(&self, _: &JSRef<Blob>) {}
pub fn AnyAttribute(&self, _: *JSContext) -> JSVal { NullValue() }
@@ -87,10 +87,10 @@ impl TestBinding {
pub fn GetStringAttributeNullable(&self) -> Option<DOMString> { Some(~"") }
pub fn SetStringAttributeNullable(&self, _: Option<DOMString>) {}
pub fn GetEnumAttributeNullable(&self) -> Option<TestEnum> { Some(_empty) }
- pub fn GetInterfaceAttributeNullable(&self) -> Option<JS<Blob>> {
+ pub fn GetInterfaceAttributeNullable(&self) -> Option<Unrooted<Blob>> {
let roots = RootCollection::new();
let window = self.window.root(&roots);
- Some(Blob::new(&window.root_ref()))
+ Some(Blob::new(&(*window)))
}
pub fn SetInterfaceAttributeNullable(&self, _: Option<JSRef<Blob>>) {}