DOM bindings: Autogenerate list of prototypes and binding registration goop.

This commit is contained in:
Josh Matthews 2013-07-11 01:22:00 -04:00
parent 65f9aefb78
commit 4f24ef1619
12 changed files with 262 additions and 84 deletions

View file

@ -2,8 +2,8 @@
* 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::utils::{CacheableWrapper, WrapperCache};
use script_task::global_script_context;
use dom::bindings::utils::{CacheableWrapper, WrapperCache, BindingObject};
use script_task::{global_script_context, task_from_context};
use js::jsapi::{JSContext, JSObject};
@ -28,6 +28,15 @@ impl WindowProxy {
}
}
impl BindingObject for WindowProxy {
fn GetParentObject(&self, cx: *JSContext) -> @mut CacheableWrapper {
let script_context = task_from_context(cx);
unsafe {
(*script_context).root_frame.get_ref().window as @mut CacheableWrapper
}
}
}
impl CacheableWrapper for WindowProxy {
fn get_wrappercache(&mut self) -> &mut WrapperCache {
return self.get_wrappercache()