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

Unified Diff: net/http/http_cache_transaction.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
Index: net/http/http_cache_transaction.h
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index 080d8b923bffea7c40e20dfaf7ddbe10c608f234..62b216cf6271bf1457914bc15291a144671dc835 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -175,6 +175,9 @@ class HttpCache::Transaction : public HttpTransaction {
// Returns the estimate of dynamically allocated memory in bytes.
size_t EstimateMemoryUsage() const;
+ // ### comment
+ bool MaybeRejectBasedOnMemoryEntryData(uint8_t in_memory_info);
+
private:
static const size_t kNumValidationHeaders = 2;
// Helper struct to pair a header name with its value, for
@@ -367,6 +370,11 @@ class HttpCache::Transaction : public HttpTransaction {
// copy is valid). Returns true if able to make the request conditional.
bool ConditionalizeRequest();
+ // Determines if saved response permits conditionalization, and extracts
+ // etag/last-modified values. Only depends on response_.headers.
+ bool ResponseConditionalizable(std::string* etag_value,
+ std::string* last_modified_value);
+
// Makes sure that a 206 response is expected. Returns true on success.
// On success, handling_206_ will be set to true if we are processing a
// partial entry.

Powered by Google App Engine
This is Rietveld 408576698