Issue #1820 - Improve the Blob implementation

This commit is contained in:
Shing Lyu 2014-11-14 23:56:48 +08:00 committed by Shing Lyu
parent bdb3a2538b
commit f2885b8fc7
6 changed files with 125 additions and 22 deletions

View file

@ -18,9 +18,9 @@ pub struct File {
}
impl File {
fn new_inherited(_file_bits: JSRef<Blob>, name: DOMString) -> File {
fn new_inherited(global: &GlobalRef, _file_bits: JSRef<Blob>, name: DOMString) -> File {
File {
blob: Blob::new_inherited(),
blob: Blob::new_inherited(global, None),
name: name,
type_: FileTypeId
}
@ -28,9 +28,9 @@ impl File {
// the relevant subfields of file_bits should be copied over
}
pub fn new(global: GlobalRef, file_bits: JSRef<Blob>, name: DOMString) -> Temporary<File> {
reflect_dom_object(box File::new_inherited(file_bits, name),
global,
pub fn new(global: &GlobalRef, file_bits: JSRef<Blob>, name: DOMString) -> Temporary<File> {
reflect_dom_object(box File::new_inherited(global, file_bits, name),
*global,
FileBinding::Wrap)
}