Implement safe rooting strategy via Unrooted, Root, JSRef, and JS.

This commit is contained in:
Josh Matthews 2014-03-31 18:41:28 -04:00
parent ffdc3f5b32
commit d7b96db33c
109 changed files with 1568 additions and 1326 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::BindingDeclarations::ClientRectBinding;
use dom::bindings::js::{JS, JSRef};
use dom::bindings::js::{JS, JSRef, Unrooted};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::window::Window;
use servo_util::geometry::Au;
@ -34,7 +34,7 @@ impl ClientRect {
pub fn new(window: &JSRef<Window>,
top: Au, bottom: Au,
left: Au, right: Au) -> JS<ClientRect> {
left: Au, right: Au) -> Unrooted<ClientRect> {
let rect = ClientRect::new_inherited(window.unrooted(), top, bottom, left, right);
reflect_dom_object(~rect, window, ClientRectBinding::Wrap)
}