Remove unused windows/globals

This commit is contained in:
Manish Goregaokar 2014-08-08 23:46:29 +05:30
parent 70e70fd1d9
commit deed48a759
3 changed files with 9 additions and 14 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::InheritTypes::FileDerived; use dom::bindings::codegen::InheritTypes::FileDerived;
use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::global::GlobalRef;
use dom::bindings::js::Temporary; use dom::bindings::js::Temporary;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
@ -18,21 +18,19 @@ pub enum BlobType {
#[deriving(Encodable)] #[deriving(Encodable)]
pub struct Blob { pub struct Blob {
reflector_: Reflector, reflector_: Reflector,
global: GlobalField,
type_: BlobType type_: BlobType
} }
impl Blob { impl Blob {
pub fn new_inherited(global: &GlobalRef) -> Blob { pub fn new_inherited() -> Blob {
Blob { Blob {
reflector_: Reflector::new(), reflector_: Reflector::new(),
global: GlobalField::from_rooted(global),
type_: BlobTypeId type_: BlobTypeId
} }
} }
pub fn new(global: &GlobalRef) -> Temporary<Blob> { pub fn new(global: &GlobalRef) -> Temporary<Blob> {
reflect_dom_object(box Blob::new_inherited(global), reflect_dom_object(box Blob::new_inherited(),
global, global,
BlobBinding::Wrap) BlobBinding::Wrap)
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::Bindings::ClientRectBinding; use dom::bindings::codegen::Bindings::ClientRectBinding;
use dom::bindings::codegen::Bindings::ClientRectBinding::ClientRectMethods; use dom::bindings::codegen::Bindings::ClientRectBinding::ClientRectMethods;
use dom::bindings::global::Window; use dom::bindings::global::Window;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::window::Window; use dom::window::Window;
use servo_util::geometry::Au; use servo_util::geometry::Au;
@ -17,12 +17,10 @@ pub struct ClientRect {
bottom: f32, bottom: f32,
left: f32, left: f32,
right: f32, right: f32,
window: JS<Window>,
} }
impl ClientRect { impl ClientRect {
pub fn new_inherited(window: &JSRef<Window>, pub fn new_inherited(top: Au, bottom: Au,
top: Au, bottom: Au,
left: Au, right: Au) -> ClientRect { left: Au, right: Au) -> ClientRect {
ClientRect { ClientRect {
top: top.to_nearest_px() as f32, top: top.to_nearest_px() as f32,
@ -30,14 +28,13 @@ impl ClientRect {
left: left.to_nearest_px() as f32, left: left.to_nearest_px() as f32,
right: right.to_nearest_px() as f32, right: right.to_nearest_px() as f32,
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: JS::from_rooted(window),
} }
} }
pub fn new(window: &JSRef<Window>, pub fn new(window: &JSRef<Window>,
top: Au, bottom: Au, top: Au, bottom: Au,
left: Au, right: Au) -> Temporary<ClientRect> { left: Au, right: Au) -> Temporary<ClientRect> {
let rect = ClientRect::new_inherited(window, top, bottom, left, right); let rect = ClientRect::new_inherited(top, bottom, left, right);
reflect_dom_object(box rect, &Window(*window), ClientRectBinding::Wrap) reflect_dom_object(box rect, &Window(*window), ClientRectBinding::Wrap)
} }
} }

View file

@ -18,9 +18,9 @@ pub struct File {
} }
impl File { impl File {
pub fn new_inherited(global: &GlobalRef, _file_bits: &JSRef<Blob>, name: DOMString) -> File { pub fn new_inherited(_file_bits: &JSRef<Blob>, name: DOMString) -> File {
File { File {
blob: Blob::new_inherited(global), blob: Blob::new_inherited(),
name: name, name: name,
type_: FileTypeId type_: FileTypeId
} }
@ -29,7 +29,7 @@ impl File {
} }
pub fn new(global: &GlobalRef, file_bits: &JSRef<Blob>, name: DOMString) -> Temporary<File> { pub fn new(global: &GlobalRef, file_bits: &JSRef<Blob>, name: DOMString) -> Temporary<File> {
reflect_dom_object(box File::new_inherited(global, file_bits, name), reflect_dom_object(box File::new_inherited(file_bits, name),
global, global,
FileBinding::Wrap) FileBinding::Wrap)
} }