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

Unified Diff: storage/browser/blob/blob_storage_registry.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/blob_storage_registry.cc
diff --git a/storage/browser/blob/blob_storage_registry.cc b/storage/browser/blob/blob_storage_registry.cc
index a0f03b25fd42a73fbd3cff7e6358c33992c27243..5660e80f0be670df4afcaa79e37d9081c5b072d6 100644
--- a/storage/browser/blob/blob_storage_registry.cc
+++ b/storage/browser/blob/blob_storage_registry.cc
@@ -17,7 +17,6 @@
#include "url/gurl.h"
namespace storage {
-using BlobState = BlobStorageRegistry::BlobState;
namespace {
// We can't use GURL directly for these hash fragment manipulations
@@ -38,18 +37,22 @@ GURL ClearBlobUrlRef(const GURL& url) {
} // namespace
-BlobStorageRegistry::Entry::Entry(int refcount, BlobState state)
- : refcount(refcount), state(state) {}
+BlobStorageRegistry::ItemCopyEntry::ItemCopyEntry(
+ scoped_refptr<ShareableBlobDataItem> source_item,
+ size_t source_item_offset,
+ scoped_refptr<ShareableBlobDataItem> dest_item)
+ : source_item(std::move(source_item)),
+ source_item_offset(source_item_offset),
+ dest_item(std::move(dest_item)) {}
-BlobStorageRegistry::Entry::~Entry() {}
+BlobStorageRegistry::ItemCopyEntry::ItemCopyEntry(const ItemCopyEntry&) =
+ default;
-bool BlobStorageRegistry::Entry::TestAndSetState(BlobState expected,
- BlobState set) {
- if (state != expected)
- return false;
- state = set;
- return true;
-}
+BlobStorageRegistry::ItemCopyEntry::~ItemCopyEntry() {}
+
+BlobStorageRegistry::Entry::Entry() {}
+
+BlobStorageRegistry::Entry::~Entry() {}
BlobStorageRegistry::BlobStorageRegistry() {}
@@ -64,7 +67,7 @@ BlobStorageRegistry::Entry* BlobStorageRegistry::CreateEntry(
const std::string& content_type,
const std::string& content_disposition) {
DCHECK(!ContainsKey(blob_map_, uuid));
- std::unique_ptr<Entry> entry(new Entry(1, BlobState::PENDING));
+ std::unique_ptr<Entry> entry(new Entry());
entry->content_type = content_type;
entry->content_disposition = content_disposition;
Entry* entry_ptr = entry.get();

Powered by Google App Engine
This is Rietveld 408576698