aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/blob.rs
diff options
context:
space:
mode:
authorRussell Cousineau <miller.time.baby@gmail.com>2019-03-15 18:02:55 -0700
committerRussell Cousineau <miller.time.baby@gmail.com>2019-03-18 18:27:46 -0700
commitd9beca6fec8ebd48f0e8d06b06b2c28c8183a253 (patch)
tree2e6416dd1fdf6b3b455e1cb03b3c42001adc5ebe /components/script/dom/blob.rs
parent34fda66dfa5528f2b10a873e9a67417c6986c712 (diff)
downloadservo-d9beca6fec8ebd48f0e8d06b06b2c28c8183a253.tar.gz
servo-d9beca6fec8ebd48f0e8d06b06b2c28c8183a253.zip
create uuid before sending PromoteMemory message
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r--components/script/dom/blob.rs24
1 files changed, 9 insertions, 15 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index d8c3966469a..b97b703e4bb 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -238,23 +238,17 @@ impl Blob {
bytes: bytes.to_vec(),
};
- let (tx, rx) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();
- let msg = FileManagerThreadMsg::PromoteMemory(blob_buf, set_valid, tx, origin.clone());
+ let id = Uuid::new_v4();
+ let msg = FileManagerThreadMsg::PromoteMemory(id, blob_buf, set_valid, origin.clone());
self.send_to_file_manager(msg);
- match rx.recv().unwrap() {
- Ok(id) => {
- *self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob {
- id: id.clone(),
- name: None,
- cache: DomRefCell::new(Some(bytes.to_vec())),
- size: bytes.len() as u64,
- });
- id
- },
- // Dummy id
- Err(_) => Uuid::new_v4(),
- }
+ *self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob {
+ id: id.clone(),
+ name: None,
+ cache: DomRefCell::new(Some(bytes.to_vec())),
+ size: bytes.len() as u64,
+ });
+ id
}
/// Get a FileID representing sliced parent-blob content