aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/testbinding.rs')
-rw-r--r--src/components/script/dom/testbinding.rs26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/components/script/dom/testbinding.rs b/src/components/script/dom/testbinding.rs
index 72d2f68dd88..bf3e5f2d232 100644
--- a/src/components/script/dom/testbinding.rs
+++ b/src/components/script/dom/testbinding.rs
@@ -2,27 +2,25 @@
* 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, Temporary};
use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnum;
use dom::bindings::codegen::Bindings::TestBindingBinding::TestEnumValues::_empty;
use dom::bindings::codegen::UnionTypes::BlobOrString::BlobOrString;
use dom::bindings::codegen::UnionTypes::EventOrString::{EventOrString, eString};
use dom::bindings::codegen::UnionTypes::HTMLElementOrLong::{HTMLElementOrLong, eLong};
+use dom::bindings::global::GlobalField;
+use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::str::ByteString;
use dom::bindings::utils::{Reflector, Reflectable};
use dom::blob::Blob;
-use dom::window::Window;
use servo_util::str::DOMString;
use js::jsapi::JSContext;
use js::jsval::{JSVal, NullValue};
-use std::cell::Cell;
-
#[deriving(Encodable)]
pub struct TestBinding {
- pub reflector: Reflector,
- pub window: Cell<JS<Window>>,
+ reflector: Reflector,
+ global: GlobalField,
}
pub trait TestBindingMethods {
@@ -279,20 +277,20 @@ pub trait TestBindingMethods {
impl<'a> TestBindingMethods for JSRef<'a, TestBinding> {
fn InterfaceAttribute(&self) -> Temporary<Blob> {
- let window = self.window.get().root();
- Blob::new(&*window)
+ let global = self.global.root();
+ Blob::new(&global.root_ref())
}
fn GetInterfaceAttributeNullable(&self) -> Option<Temporary<Blob>> {
- let window = self.window.get().root();
- Some(Blob::new(&*window))
+ let global = self.global.root();
+ Some(Blob::new(&global.root_ref()))
}
fn ReceiveInterface(&self) -> Temporary<Blob> {
- let window = self.window.get().root();
- Blob::new(&*window)
+ let global = self.global.root();
+ Blob::new(&global.root_ref())
}
fn ReceiveNullableInterface(&self) -> Option<Temporary<Blob>> {
- let window = self.window.get().root();
- Some(Blob::new(&*window))
+ let global = self.global.root();
+ Some(Blob::new(&global.root_ref()))
}
}