diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-03-31 18:41:28 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2014-05-03 14:18:30 -0400 |
commit | d7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1 (patch) | |
tree | efd1e7f7ec1dd30467c2a67306e1a639837abead /src/components/script/dom/testbinding.rs | |
parent | ffdc3f5b32a345b88eed774848924e862d47c093 (diff) | |
download | servo-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.rs | 10 |
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>>) {} |