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

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

Issue 1528233004: [Blob] Blob paging to disk patch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-disk1
Patch Set: Created 5 years 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/blob_storage_context.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 4c2f9c1833262d18dfa82b622abdfef8585b9541..4ffbbe2f50bb8c30a526bbab57f6e55abd9acbac 100644
--- a/storage/browser/blob/shareable_blob_data_item.h
+++ b/storage/browser/blob/shareable_blob_data_item.h
@@ -23,23 +23,31 @@ 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).
-class ShareableBlobDataItem : public base::RefCounted<ShareableBlobDataItem> {
+class ShareableBlobDataItem
+ : public base::RefCountedThreadSafe<ShareableBlobDataItem> {
public:
ShareableBlobDataItem(const std::string& blob_uuid,
+ uint64_t item_id,
const scoped_refptr<BlobDataItem>& item);
+ const uint64_t item_id() { return item_id_; }
+
const scoped_refptr<BlobDataItem>& item();
base::hash_set<std::string>& referencing_blobs() {
return referencing_blobs_;
}
+ size_t num_referencing_blob() const { return referencing_blobs_.size(); }
+
private:
- friend class base::RefCounted<ShareableBlobDataItem>;
+ friend class base::RefCountedThreadSafe<ShareableBlobDataItem>;
friend class InternalBlobData;
+ friend class BlobMemoryController;
~ShareableBlobDataItem();
scoped_refptr<BlobDataItem> item_;
+ uint64_t item_id_;
base::hash_set<std::string> referencing_blobs_;
« no previous file with comments | « storage/browser/blob/blob_storage_context.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