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

Unified Diff: storage/common/data_element.h

Issue 1108083002: Create blobs from Disk Cache entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: omg, fix the correct base::Unretained... Created 5 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/common/data_element.h
diff --git a/storage/common/data_element.h b/storage/common/data_element.h
index 0efe1550a91e9a509d1cc0548854167a58c3a689..2eeca8e1d9513eb53e384bad97c2e2cea8d9cfc3 100644
--- a/storage/common/data_element.h
+++ b/storage/common/data_element.h
@@ -27,6 +27,7 @@ class STORAGE_COMMON_EXPORT DataElement {
TYPE_FILE,
TYPE_BLOB,
TYPE_FILE_FILESYSTEM,
+ TYPE_DISK_CACHE_ENTRY,
};
DataElement();
@@ -102,6 +103,9 @@ class STORAGE_COMMON_EXPORT DataElement {
uint64 offset, uint64 length,
const base::Time& expected_modification_time);
+ // Sets to TYPE_DISK_CACHE_ENTRY with range.
+ void SetToDiskCacheEntryRange(uint64 offset, uint64 length);
+
private:
Type type_;
std::vector<char> buf_; // For TYPE_BYTES.
@@ -130,6 +134,10 @@ inline bool operator==(const DataElement& a, const DataElement& b) {
return a.blob_uuid() == b.blob_uuid();
case DataElement::TYPE_FILE_FILESYSTEM:
return a.filesystem_url() == b.filesystem_url();
+ case DataElement::TYPE_DISK_CACHE_ENTRY:
+ // We compare only length and offset; we trust the entry itself was
+ // compared at some higher level such as in BlobDataItem.
+ return true;
case DataElement::TYPE_UNKNOWN:
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698