Index: net/http/mock_http_cache.cc |
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc |
index bf81c4ee1eea6f6c14f5ff5544c7a31184b507cc..a8ea3a4b06929f1e6cca8e0567f9e152bd5d9e01 100644 |
--- a/net/http/mock_http_cache.cc |
+++ b/net/http/mock_http_cache.cc |
@@ -68,6 +68,7 @@ struct MockDiskEntry::CallbackInfo { |
MockDiskEntry::MockDiskEntry(const std::string& key) |
: key_(key), |
+ memory_entry_data_(0), |
doomed_(false), |
sparse_(false), |
fail_requests_(false), |
@@ -394,6 +395,7 @@ MockDiskCache::MockDiskCache() |
soft_failures_(false), |
double_create_check_(true), |
fail_sparse_requests_(false), |
+ support_memory_entry_data_(true), |
defer_op_(MockDiskEntry::DEFER_NONE), |
resume_return_code_(0) {} |
@@ -552,6 +554,22 @@ size_t MockDiskCache::DumpMemoryStats( |
return 0u; |
} |
+uint8_t MockDiskCache::GetMemoryEntryData(const std::string& key) { |
+ if (!support_memory_entry_data_) |
+ return 0; |
+ |
+ EntryMap::iterator it = entries_.find(key); |
+ if (it != entries_.end()) |
+ return it->second->memory_entry_data(); |
+ return 0; |
+} |
+ |
+void MockDiskCache::SetMemoryEntryData(const std::string& key, uint8_t data) { |
+ EntryMap::iterator it = entries_.find(key); |
+ if (it != entries_.end()) |
+ it->second->set_memory_entry_data(data); |
+} |
+ |
void MockDiskCache::ReleaseAll() { |
for (auto entry : entries_) |
entry.second->Release(); |