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

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: - Implement support for oracle bytes in MockHttpCache, so the code actually gets exercised in tests… 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
Index: net/http/mock_http_cache.h
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h
index a24200bf8348cd2ea0ed018a54c7832386195bad..b82df5df5f5e3b44d811481e5cc5f75ccf6d44ff 100644
--- a/net/http/mock_http_cache.h
+++ b/net/http/mock_http_cache.h
@@ -37,6 +37,8 @@ class MockDiskEntry : public disk_cache::Entry,
base::Time GetLastUsed() const override;
base::Time GetLastModified() const override;
int32_t GetDataSize(int index) const override;
+ uint8_t GetOracleByte() const { return oracle_byte_; }
+ void SetOracleByte(uint8_t val) override;
int ReadData(int index,
int offset,
IOBuffer* buf,
@@ -98,6 +100,7 @@ class MockDiskEntry : public disk_cache::Entry,
std::string key_;
std::vector<char> data_[kNumCacheEntryDataIndices];
+ unsigned char oracle_byte_;
int test_mode_;
bool doomed_;
bool sparse_;
@@ -119,6 +122,10 @@ class MockDiskCache : public disk_cache::Backend {
int OpenEntry(const std::string& key,
disk_cache::Entry** entry,
const CompletionCallback& callback) override;
+ int OpenEntryWithOracleByte(const std::string& key,
+ disk_cache::Entry** entry,
+ const OracleCallback& oracle,
+ const CompletionCallback& callback) override;
int CreateEntry(const std::string& key,
disk_cache::Entry** entry,
const CompletionCallback& callback) override;

Powered by Google App Engine
This is Rietveld 408576698