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

Unified Diff: storage/browser/blob/shareable_blob_data_item.h

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « storage/browser/blob/internal_blob_data.cc ('k') | storage/browser/blob/shareable_blob_data_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/blob/shareable_blob_data_item.h
diff --git a/storage/browser/blob/shareable_blob_data_item.h b/storage/browser/blob/shareable_blob_data_item.h
index b356c0c78a13f465456c0ff12d7fcaff7103ff77..e5e6e7e14107fce2e5ba9a0e3bd09ae993178e6a 100644
--- a/storage/browser/blob/shareable_blob_data_item.h
+++ b/storage/browser/blob/shareable_blob_data_item.h
@@ -25,8 +25,8 @@ class InternalBlobData;
// The data in this class (the item) is immutable, but the item itself can be
// swapped out with an item with the same data but a different backing (think
// RAM vs file backed).
-// We also allow the storage of a deletion closure which is used for memory
-// quota reclamation.
+// We also allow the storage of a memory quota allocation objeect which is used
+// for memory quota reclamation.
class STORAGE_EXPORT ShareableBlobDataItem
: public base::RefCounted<ShareableBlobDataItem> {
public:
@@ -44,11 +44,10 @@ class STORAGE_EXPORT ShareableBlobDataItem
POPULATED_WITHOUT_QUOTA
};
- ShareableBlobDataItem(const std::string& referencing_blob_uuid,
- scoped_refptr<BlobDataItem> item,
- State state);
+ ShareableBlobDataItem(scoped_refptr<BlobDataItem> item, State state);
const scoped_refptr<BlobDataItem>& item() const { return item_; }
+
void set_item(scoped_refptr<BlobDataItem> item);
// This is a unique auto-incrementing id assigned to this item on
@@ -77,6 +76,7 @@ class STORAGE_EXPORT ShareableBlobDataItem
private:
friend class BlobMemoryController;
friend class BlobMemoryControllerTest;
+ friend class BlobStorageContext;
friend class base::RefCounted<ShareableBlobDataItem>;
friend STORAGE_EXPORT void PrintTo(const ShareableBlobDataItem& x,
::std::ostream* os);
@@ -88,6 +88,8 @@ class STORAGE_EXPORT ShareableBlobDataItem
memory_allocation_ = std::move(allocation);
}
+ bool has_memory_allocation() { return static_cast<bool>(memory_allocation_); }
+
// This is a unique identifier for this ShareableBlobDataItem.
const uint64_t item_id_;
State state_;
« no previous file with comments | « storage/browser/blob/internal_blob_data.cc ('k') | storage/browser/blob/shareable_blob_data_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698