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

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: rebase better 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..a35d29d74bfbeab57665196c25e7b220f4aa4c47 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,12 @@ 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:
+ // This comparison is really problematic; we could compare length and
+ // offset, but that would be deceptive: the disk cache entry itself can't
+ // be in the DataElement since it isn't serlializable. Thus, return |true|
+ // each time.
jkarlin 2015/06/12 15:53:38 How about NOTREACHED()?
gavinp 2015/06/12 18:10:30 It introduces crashes. The comment was deceptive,
+ return true;
case DataElement::TYPE_UNKNOWN:
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698