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

Unified Diff: net/http/mock_http_cache.cc

Issue 2922973003: RFC: use some in-memory state in SimpleCache to quickly cache-miss some CantConditionalize cases
Patch Set: omewhat better take at higher-level HC::T impl, a bit lessy hacky, and actually write to cache now. Created 3 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
« net/http/mock_http_cache.h ('K') | « net/http/mock_http_cache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/mock_http_cache.cc
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index e676122b53f4c77492d3676dac08bf517b0220dd..5b2d838d54ced895cd472c4cd17bf96564532a8e 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),
@@ -521,6 +522,19 @@ size_t MockDiskCache::DumpMemoryStats(
return 0u;
}
+uint8_t MockDiskCache::GetMemoryEntryData(const std::string& key) {
+ 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() {
EntryMap::iterator it = entries_.begin();
for (; it != entries_.end(); ++it)
« net/http/mock_http_cache.h ('K') | « net/http/mock_http_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698