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

Unified Diff: net/http/http_cache_transaction.h

Issue 2721933002: HttpCache::Transaction layer allowing parallel validation (Closed)
Patch Set: Feedback addressed. Created 3 years, 9 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 a8fca54228e8d8f6cadda6b947e90ab7bf24cd94..7ecf7cdd8e4d804276d72cd544c8e9aad0b5b5c2 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -164,6 +164,10 @@ class HttpCache::Transaction : public HttpTransaction {
int ResumeNetworkStart() override;
void GetConnectionAttempts(ConnectionAttempts* out) const override;
+ // Invoked when parallel validation cannot proceed due to response failure
+ // and this transaction needs to be restarted.
+ void SetValidatingCannotProceed();
+
// Returns the estimate of dynamically allocated memory in bytes.
size_t EstimateMemoryUsage() const;
@@ -220,6 +224,9 @@ class HttpCache::Transaction : public HttpTransaction {
STATE_PARTIAL_HEADERS_RECEIVED,
STATE_CACHE_READ_METADATA,
STATE_CACHE_READ_METADATA_COMPLETE,
+ STATE_HEADERS_PHASE_CANNOT_PROCEED,
+ STATE_FINISH_HEADERS,
+ STATE_FINISH_HEADERS_COMPLETE,
// These states are entered from Read/AddTruncatedFlag.
STATE_NETWORK_READ,
@@ -286,6 +293,9 @@ class HttpCache::Transaction : public HttpTransaction {
int DoTruncateCachedMetadata();
int DoTruncateCachedMetadataComplete(int result);
int DoPartialHeadersReceived();
+ int DoHeadersPhaseCannotProceed();
+ int DoFinishHeaders(int result);
+ int DoFinishHeadersComplete(int result);
int DoCacheReadMetadata();
int DoCacheReadMetadataComplete(int result);
int DoNetworkRead();
@@ -457,6 +467,7 @@ class HttpCache::Transaction : public HttpTransaction {
const HttpResponseInfo* new_response_;
std::string cache_key_;
Mode mode_;
+ Mode original_mode_; // Used when restarting the transaction.
bool reading_; // We are already reading. Never reverts to false once set.
bool invalid_range_; // We may bypass the cache for this request.
bool truncated_; // We don't have all the response data.

Powered by Google App Engine
This is Rietveld 408576698