OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // TODO - maybe this mojom should just live in //storage? |
| 6 |
| 7 module content.mojom; |
| 8 |
| 9 // Maps to storage::DataElement. |
| 10 [Native] |
| 11 struct StorageDataElement; |
| 12 |
| 13 // TODO: de-dupe this and the definition in blob_storage_constants.h |
| 14 enum BlobCreationCancelCode { |
| 15 UNKNOWN = 0, |
| 16 OUT_OF_MEMORY = 1, |
| 17 // We couldn't create or write to a file. File system error, like a full disk. |
| 18 FILE_WRITE_FAILED = 2, |
| 19 // The renderer was destroyed while data was in transit. |
| 20 SOURCE_DIED_IN_TRANSIT = 3, |
| 21 // The renderer destructed the blob before it was done transferring, and there |
| 22 // were no outstanding references (no one is waiting to read) to keep the |
| 23 // blob alive. |
| 24 BLOB_DEREFERENCED_WHILE_BUILDING = 4, |
| 25 // A blob that we referenced during construction is broken, or a browser-side |
| 26 // builder tries to build a blob with a blob reference that isn't finished |
| 27 // constructing. |
| 28 REFERENCED_BLOB_BROKEN = 5, |
| 29 LAST = 5, |
| 30 }; |
| 31 |
| 32 // TODO |
| 33 interface Blob {}; |
| 34 |
| 35 interface BlobFactory { |
| 36 RegisterBlobUUID(string uuid, string content_type, string content_disposition, |
| 37 array<string> referenced_blob_uuids); |
| 38 |
| 39 // Builds a new blob. |
| 40 // |
| 41 // The StorageDataElements are used to: |
| 42 // * describe & transport non-memory resources (blobs, files, etc) |
| 43 // * describe the size of memory items |
| 44 // * 'shortcut' transport the memory up to the IPC limit so the browser can us
e |
| 45 // it if it's not currently full. |
| 46 // See https://bit.ly/BlobStorageRefactor |
| 47 // |
| 48 // This returns a handle to a Blob interface if successful. Otherwise the |
| 49 // build request was cancelled and |cancel_code| indicates why. If |blob| is |
| 50 // non-null, |cancel_code| is unspecified and should be ignored. |
| 51 BuildBlob(string uuid, string content_type, string content_disposition, |
| 52 array<string> referenced_blob_uuids, |
| 53 array<StorageDataElement> item_descriptions) |
| 54 => (associated Blob? blob, BlobCreationCancelCode cancel_code); |
| 55 }; |
OLD | NEW |