Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // TODO: Insert description here. (generated by dmurph) | |
| 2 | |
| 3 #ifndef STORAGE_BROWSER_BLOB_BLOB_DATA_SNAPSHOT_H_ | |
| 4 #define STORAGE_BROWSER_BLOB_BLOB_DATA_SNAPSHOT_H_ | |
| 5 | |
| 6 #include <string> | |
| 7 #include <vector> | |
| 8 | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/supports_user_data.h" | |
| 11 #include "storage/browser/blob/blob_data_item.h" | |
| 12 #include "storage/browser/storage_browser_export.h" | |
| 13 | |
| 14 namespace storage { | |
| 15 class BlobDataBuilder; | |
| 16 | |
| 17 // Snapshot of a Blob. This snapshot holds a refcount of the current | |
| 18 // blob item resources so the backing storage for these items will stick | |
| 19 // around for the lifetime of this object. (The data represented by a blob is | |
| 20 // immutable, but the backing store can change). This structure thread safe. | |
| 21 class STORAGE_EXPORT BlobDataSnapshot : public base::SupportsUserData::Data { | |
| 22 public: | |
| 23 BlobDataSnapshot(const BlobDataSnapshot& other); | |
| 24 ~BlobDataSnapshot() override; | |
| 25 | |
| 26 const std::string& uuid() const { return uuid_; } | |
|
michaeln
2015/01/22 02:26:34
A snapshot may outlive the registered blob, so thi
dmurph
2015/01/23 00:10:18
As discussed, removed the uuid here, and clarified
| |
| 27 const std::vector<scoped_refptr<BlobDataItem>>& items() const { | |
| 28 return items_; | |
| 29 } | |
| 30 const std::string& content_type() const { return content_type_; } | |
| 31 const std::string& content_disposition() const { | |
| 32 return content_disposition_; | |
| 33 } | |
| 34 size_t GetMemoryUsage() const; | |
| 35 | |
| 36 private: | |
| 37 friend class BlobDataBuilder; | |
| 38 BlobDataSnapshot(const std::string& uuid, | |
| 39 const std::string& content_type, | |
| 40 const std::string& content_disposition, | |
| 41 const std::vector<scoped_refptr<BlobDataItem>>& items); | |
| 42 | |
| 43 const std::string uuid_; | |
| 44 const std::string content_type_; | |
| 45 const std::string content_disposition_; | |
| 46 const std::vector<scoped_refptr<BlobDataItem>> items_; | |
| 47 }; | |
| 48 | |
| 49 } // namespace storage | |
| 50 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_SNAPSHOT_H_ | |
| OLD | NEW |