diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-08-17 06:38:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-17 06:38:34 -0500 |
commit | f4f212fd18290eab51eaac972335cec60d2a34e0 (patch) | |
tree | 08ffe80dce6dd3d8e6e16a15d9d84fa68bddfb1b /components/script/dom/blob.rs | |
parent | 2eb03287388346517344b90c7d6da09d54da2596 (diff) | |
parent | cd9fc4919dfd626b0bac5d899860d4ee8f963355 (diff) | |
download | servo-f4f212fd18290eab51eaac972335cec60d2a34e0.tar.gz servo-f4f212fd18290eab51eaac972335cec60d2a34e0.zip |
Auto merge of #12897 - izgzhen:improve-file-api-comments, r=Manishearth
Improve File API related comments
r? @Manishearth
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12897)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r-- | components/script/dom/blob.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 11f323af6be..49eff910cd9 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -33,17 +33,18 @@ pub struct FileBlob { } -/// Blob backend implementation +/// Different backends of Blob #[must_root] #[derive(JSTraceable)] pub enum BlobImpl { - /// File-based blob + /// File-based blob, whose content lives in the net process File(FileBlob), - /// Memory-based blob + /// Memory-based blob, whose content lives in the script process Memory(Vec<u8>), - /// Sliced blob, including parent blob and - /// relative positions representing current slicing range, - /// it is leaf of a two-layer fat tree + /// Sliced blob, including parent blob reference and + /// relative positions of current slicing range, + /// IMPORTANT: The depth of tree is only two, i.e. the parent Blob must be + /// either File-based or Memory-based Sliced(JS<Blob>, RelativePos), } @@ -71,6 +72,7 @@ pub struct Blob { reflector_: Reflector, #[ignore_heap_size_of = "No clear owner"] blob_impl: DOMRefCell<BlobImpl>, + /// content-type string typeString: String, isClosed_: Cell<bool>, } @@ -181,7 +183,7 @@ impl Blob { /// Promote non-Slice blob: /// 1. Memory-based: The bytes in data slice will be transferred to file manager thread. - /// 2. File-based: Activation + /// 2. File-based: If set_valid, then activate the FileID so it can serve as URL /// Depending on set_valid, the returned FileID can be part of /// valid or invalid Blob URL. fn promote(&self, set_valid: bool) -> SelectedFileId { |