mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Use Cell/RefCell for interior mutability of NodeList, Performance, TestBinding, and ValidityState.
This commit is contained in:
parent
2215e2ca80
commit
aaa8c838d2
3 changed files with 12 additions and 9 deletions
|
@ -15,10 +15,12 @@ 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: JS<Window>,
|
||||
pub window: Cell<JS<Window>>,
|
||||
}
|
||||
|
||||
pub trait TestBindingMethods {
|
||||
|
@ -243,19 +245,19 @@ pub trait TestBindingMethods {
|
|||
|
||||
impl<'a> TestBindingMethods for JSRef<'a, TestBinding> {
|
||||
fn InterfaceAttribute(&self) -> Temporary<Blob> {
|
||||
let window = self.window.root();
|
||||
let window = self.window.get().root();
|
||||
Blob::new(&*window)
|
||||
}
|
||||
fn GetInterfaceAttributeNullable(&self) -> Option<Temporary<Blob>> {
|
||||
let window = self.window.root();
|
||||
let window = self.window.get().root();
|
||||
Some(Blob::new(&*window))
|
||||
}
|
||||
fn ReceiveInterface(&self) -> Temporary<Blob> {
|
||||
let window = self.window.root();
|
||||
let window = self.window.get().root();
|
||||
Blob::new(&*window)
|
||||
}
|
||||
fn ReceiveNullableInterface(&self) -> Option<Temporary<Blob>> {
|
||||
let window = self.window.root();
|
||||
let window = self.window.get().root();
|
||||
Some(Blob::new(&*window))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue