mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Changed blob to use DataSlice with Arc in order to limit wasteful copying of byte vector
This commit is contained in:
parent
238a8786de
commit
76f689cd06
7 changed files with 190 additions and 132 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue