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

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: Created 5 years, 8 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..0c83e887bee0da8bee5d9f870bec11e9c126502d 100644
--- a/storage/common/data_element.h
+++ b/storage/common/data_element.h
@@ -12,6 +12,7 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/time/time.h"
+#include "net/disk_cache/disk_cache.h"
#include "storage/common/storage_common_export.h"
#include "url/gurl.h"
@@ -27,6 +28,7 @@ class STORAGE_COMMON_EXPORT DataElement {
TYPE_FILE,
TYPE_BLOB,
TYPE_FILE_FILESYSTEM,
+ TYPE_DISK_CACHE_ENTRY,
};
DataElement();
@@ -102,13 +104,16 @@ class STORAGE_COMMON_EXPORT DataElement {
uint64 offset, uint64 length,
const base::Time& expected_modification_time);
+ // Sets TYPE_DISK_CACHE_ENTRY data.
+ void SetToDiskCacheEntry();
+
private:
Type type_;
std::vector<char> buf_; // For TYPE_BYTES.
const char* bytes_; // For TYPE_BYTES.
base::FilePath path_; // For TYPE_FILE.
GURL filesystem_url_; // For TYPE_FILE_FILESYSTEM.
- std::string blob_uuid_;
+ std::string blob_uuid_; // For TYPE_BLOB and TYPE_DISK_CACHE_ENTRY.
michaeln 2015/06/12 22:35:10 where/how is this used for TYPE_DISK_CACHE_ENTRY?
uint64 offset_;
uint64 length_;
base::Time expected_modification_time_;
@@ -130,6 +135,8 @@ 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:
+ return true; // XYZZY really?
case DataElement::TYPE_UNKNOWN:
NOTREACHED();
return false;

Powered by Google App Engine
This is Rietveld 408576698