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

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

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added back transport controller test, small cleanups Created 4 years, 6 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.h
diff --git a/storage/browser/blob/blob_storage_registry.h b/storage/browser/blob/blob_storage_registry.h
index 5211094b61a2bba35c6085525f865e4c2c27d96d..4f0bddffb79c2aefb48fbff0dfa84587000b3da9 100644
--- a/storage/browser/blob/blob_storage_registry.h
+++ b/storage/browser/blob/blob_storage_registry.h
@@ -16,6 +16,8 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h"
#include "storage/browser/blob/internal_blob_data.h"
+#include "storage/browser/blob/blob_data_handle.h"
+#include "storage/browser/blob/blob_memory_controller.h"
#include "storage/browser/storage_browser_export.h"
#include "storage/common/blob_storage/blob_storage_constants.h"
@@ -48,30 +50,54 @@ class STORAGE_EXPORT BlobStorageRegistry {
BROKEN
};
+ struct STORAGE_EXPORT ItemCopyEntry {
+ ItemCopyEntry() {}
+ ItemCopyEntry(std::string uuid,
+ size_t source_item_index,
+ size_t source_item_offset,
+ size_t dest_item_index,
+ size_t size)
+ : uuid(uuid),
+ source_item_index(source_item_index),
+ source_item_offset(source_item_offset),
+ dest_item_index(dest_item_index),
+ size(size) {}
+
+ std::string uuid;
+
+ size_t source_item_index = 0;
Marijn Kruisselbrink 2016/06/29 22:42:21 Would it be any cleaner/simpler if instead of uuid
dmurph 2016/07/06 23:44:29 hmmmmmmmm yeah probably ;)
+ size_t source_item_offset = 0;
+ size_t dest_item_index = 0;
+ size_t size = 0;
+ };
+
struct STORAGE_EXPORT Entry {
- size_t refcount;
- BlobState state;
+ size_t refcount = 1;
+ BlobState state = BlobState::PENDING;
std::vector<BlobConstructedCallback> build_completion_callbacks;
// Only applicable if the state == BROKEN.
IPCBlobCreationCancelCode broken_reason =
IPCBlobCreationCancelCode::UNKNOWN;
- // data and data_builder are mutually exclusive.
- std::unique_ptr<InternalBlobData> data;
- std::unique_ptr<InternalBlobData::Builder> data_builder;
+ // Blob items. During construction these can be
+ InternalBlobData data;
+ bool waiting_until_user_population = false;
+ // Metadata
std::string content_type;
std::string content_disposition;
- Entry() = delete;
- Entry(int refcount, BlobState state);
- ~Entry();
+ bool can_fit_copies = true;
+ BlobMemoryController::PendingContructionEntry pending_copies_memory_entry;
+ std::vector<ItemCopyEntry> copies_from_built_reference;
+ std::vector<ItemCopyEntry> copies_to_when_built;
michaeln 2016/07/07 20:05:22 How many of these fields are only relevant when th
- // Performs a test-and-set on the state of the given blob. If the state
- // isn't as expected, we return false. Otherwise we set the new state and
- // return true.
- bool TestAndSetState(BlobState expected, BlobState set);
+ std::vector<std::unique_ptr<BlobDataHandle>> dependent_blobs;
+ size_t dependent_blobs_building = 0;
+
+ Entry();
+ ~Entry();
};
BlobStorageRegistry();

Powered by Google App Engine
This is Rietveld 408576698