Implement Blob URL's DOM interfaces

This commit is contained in:
Zhen Zhang 2016-06-11 00:26:26 +08:00
parent 5a0c98afb2
commit 4d3379392d
17 changed files with 146 additions and 97 deletions

View file

@ -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 {