aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/blob.rs
diff options
context:
space:
mode:
authorZhen Zhang <izgzhen@gmail.com>2016-07-21 18:31:46 +0200
committerZhen Zhang <izgzhen@gmail.com>2016-07-21 20:52:00 +0200
commitf598b5f7fdce7c5d64f8999c30396a3458e2660e (patch)
tree7f0c9df553ae11c9d838f0ee2caddd2b8a198f69 /components/script/dom/blob.rs
parentca9bc23b391b92d1a6e16f565b531a7fac68852c (diff)
downloadservo-f598b5f7fdce7c5d64f8999c30396a3458e2660e.tar.gz
servo-f598b5f7fdce7c5d64f8999c30396a3458e2660e.zip
Patches of File API
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r--components/script/dom/blob.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index f63e66e3b7b..1e3c74e1e26 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -20,6 +20,7 @@ use net_traits::filemanager_thread::{FileManagerThreadMsg, SelectedFileId, Relat
use std::cell::Cell;
use std::ops::Index;
use std::path::PathBuf;
+use uuid::Uuid;
/// File-based blob
#[derive(JSTraceable)]
@@ -183,7 +184,7 @@ impl Blob {
match rx.recv().unwrap() {
Ok(_) => f.id.clone(),
- Err(_) => SelectedFileId("".to_string()) // Return a dummy id on error
+ Err(_) => SelectedFileId(Uuid::new_v4().simple().to_string()) // Return a dummy id on error
}
}
BlobImpl::Memory(ref slice) => {
@@ -194,7 +195,7 @@ impl Blob {
BlobImpl::Sliced(_, _) => {
debug!("Sliced can't have a sliced parent");
// Return dummy id
- SelectedFileId("".to_string())
+ SelectedFileId(Uuid::new_v4().simple().to_string())
}
BlobImpl::File(ref f) =>
self.create_sliced_url_id(&f.id, rel_pos),
@@ -230,7 +231,7 @@ impl Blob {
match rx.recv().unwrap() {
Ok(new_id) => SelectedFileId(new_id.0),
// Dummy id
- Err(_) => SelectedFileId("".to_string()),
+ Err(_) => SelectedFileId(Uuid::new_v4().simple().to_string()),
}
}