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

Unified Diff: net/http/mock_http_cache.h

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
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/mock_http_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/mock_http_cache.h
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h
index 7718f35116974bb17bda26854341e77f7b93ba5f..49408b075a62a43e546e3a06b7af0ab62e349b16 100644
--- a/net/http/mock_http_cache.h
+++ b/net/http/mock_http_cache.h
@@ -64,6 +64,9 @@ class MockDiskEntry : public disk_cache::Entry,
void CancelSparseIO() override;
int ReadyForSparseIO(const CompletionCallback& completion_callback) override;
+ uint8_t memory_entry_data() const { return memory_entry_data_; }
gavinp 2017/06/26 20:18:11 Is this implemented here to make sure that http_ca
+ void set_memory_entry_data(uint8_t val) { memory_entry_data_ = val; }
+
// Fail most subsequent requests.
void set_fail_requests() { fail_requests_ = true; }
@@ -98,6 +101,7 @@ class MockDiskEntry : public disk_cache::Entry,
std::string key_;
std::vector<char> data_[kNumCacheEntryDataIndices];
+ unsigned char memory_entry_data_;
int test_mode_;
bool doomed_;
bool sparse_;
@@ -137,6 +141,8 @@ class MockDiskCache : public disk_cache::Backend {
size_t DumpMemoryStats(
base::trace_event::ProcessMemoryDump* pmd,
const std::string& parent_absolute_name) const override;
+ uint8_t GetMemoryEntryData(const std::string& key) override;
+ void SetMemoryEntryData(const std::string& key, uint8_t data) override;
// Returns number of times a cache entry was successfully opened.
int open_count() const { return open_count_; }
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/mock_http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698