Changed blob to use DataSlice with Arc in order to limit wasteful copying of byte vector

This commit is contained in:
David Raifaizen 2016-01-06 19:41:52 -05:00
parent 238a8786de
commit 76f689cd06
7 changed files with 190 additions and 132 deletions

View file

@ -8,6 +8,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::js::Root;
use dom::bindings::reflector::reflect_dom_object;
use dom::blob::Blob;
use std::sync::Arc;
use util::str::DOMString;
#[dom_struct]
@ -21,7 +22,7 @@ impl File {
_file_bits: &Blob, name: DOMString) -> File {
File {
//TODO: get type from the underlying filesystem instead of "".to_string()
blob: Blob::new_inherited(global, None, ""),
blob: Blob::new_inherited(global, Arc::new(Vec::new()), None, None, ""),
name: name,
}
// XXXManishearth Once Blob is able to store data