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

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

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 5 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
Index: storage/browser/blob/shareable_blob_data_item.cc
diff --git a/storage/browser/blob/shareable_blob_data_item.cc b/storage/browser/blob/shareable_blob_data_item.cc
index 40aaf9c7e10d29d40acbc73798f67f6c16030b4d..2de6f8dd3895237fa108f15b139da02d4f6e8e73 100644
--- a/storage/browser/blob/shareable_blob_data_item.cc
+++ b/storage/browser/blob/shareable_blob_data_item.cc
@@ -7,13 +7,18 @@
#include "storage/browser/blob/blob_data_item.h"
namespace storage {
+namespace {
-ShareableBlobDataItem::ShareableBlobDataItem(
- const std::string& blob_uuid,
- const scoped_refptr<BlobDataItem>& item)
- : item_(item) {
+uint64_t GetAndIncrementItemId() {
+ static uint64_t sNextItemId = 0;
+ return sNextItemId++;
+}
+
+} // namespace
+
+ShareableBlobDataItem::ShareableBlobDataItem(scoped_refptr<BlobDataItem> item)
+ : item_id_(GetAndIncrementItemId()), item_(std::move(item)) {
DCHECK_NE(item_->type(), DataElement::TYPE_BLOB);
- referencing_blobs_.insert(blob_uuid);
}
ShareableBlobDataItem::~ShareableBlobDataItem() {

Powered by Google App Engine
This is Rietveld 408576698