Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: storage/browser/blob/blob_data_snapshot.h

Issue 810403004: [Storage] Blob Storage Refactoring pt 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BUILD.gn file changes Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698