diff options
author | Zhen Zhang <izgzhen@gmail.com> | 2016-06-11 00:26:26 +0800 |
---|---|---|
committer | Zhen Zhang <izgzhen@gmail.com> | 2016-06-17 20:06:37 +0800 |
commit | 4d3379392d3d79c78fa68b0831d3f94d9da949c5 (patch) | |
tree | da7fc5cdb9bd9a1343517367f7c76b8b78950e68 /components/net_traits | |
parent | 5a0c98afb2998e7990e1c813f2bc15fe3c191638 (diff) | |
download | servo-4d3379392d3d79c78fa68b0831d3f94d9da949c5.tar.gz servo-4d3379392d3d79c78fa68b0831d3f94d9da949c5.zip |
Implement Blob URL's DOM interfaces
Diffstat (limited to 'components/net_traits')
-rw-r--r-- | components/net_traits/blob_url_store.rs | 11 | ||||
-rw-r--r-- | components/net_traits/filemanager_thread.rs | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/components/net_traits/blob_url_store.rs b/components/net_traits/blob_url_store.rs index 71d8c11b2de..34f609ab10e 100644 --- a/components/net_traits/blob_url_store.rs +++ b/components/net_traits/blob_url_store.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use ipc_channel::ipc::IpcSender; use std::str::FromStr; use url::Url; use uuid::Uuid; @@ -15,6 +16,16 @@ pub enum BlobURLStoreError { InvalidOrigin, } +#[derive(Serialize, Deserialize)] +pub enum BlobURLStoreMsg { + /// Add an entry and send back the associated uuid + /// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround + /// and should not be trusted. See issue https://github.com/servo/servo/issues/11722 + AddEntry(BlobURLStoreEntry, String, IpcSender<Result<String, BlobURLStoreError>>), + /// Delete an entry by uuid + DeleteEntry(String), +} + /// Blob URL store entry, a packaged form of Blob DOM object #[derive(Clone, Serialize, Deserialize)] pub struct BlobURLStoreEntry { diff --git a/components/net_traits/filemanager_thread.rs b/components/net_traits/filemanager_thread.rs index 122b99511b9..e4d0cb591f2 100644 --- a/components/net_traits/filemanager_thread.rs +++ b/components/net_traits/filemanager_thread.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use blob_url_store::BlobURLStoreMsg; use ipc_channel::ipc::IpcSender; use std::path::PathBuf; use super::{LoadConsumer, LoadData}; @@ -35,6 +36,9 @@ pub enum FileManagerThreadMsg { /// Delete the FileID entry DeleteFileID(SelectedFileId), + // Blob URL message + BlobURLStoreMsg(BlobURLStoreMsg), + /// Load resource by Blob URL LoadBlob(LoadData, LoadConsumer), |