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

Unified Diff: net/http/http_cache_transaction.h

Issue 2205453002: Exposing CacheEntryStatus (former TransactionPattern) via UrlRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 | « no previous file | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.h
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index 6ad51ab9080d903522df5ad3becf1cd0ea457fc0..44b0065c444d843094b3e5fdabf26785ae29af4d 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -229,23 +229,6 @@ class HttpCache::Transaction : public HttpTransaction {
STATE_CACHE_WRITE_TRUNCATED_RESPONSE_COMPLETE
};
- // Used for categorizing transactions for reporting in histograms. Patterns
- // cover relatively common use cases being measured and considered for
- // optimization. Many use cases that are more complex or uncommon are binned
- // as PATTERN_NOT_COVERED, and details are not reported.
- // NOTE: This enumeration is used in histograms, so please do not add entries
- // in the middle.
- enum TransactionPattern {
- PATTERN_UNDEFINED,
- PATTERN_NOT_COVERED,
- PATTERN_ENTRY_NOT_CACHED,
- PATTERN_ENTRY_USED,
- PATTERN_ENTRY_VALIDATED,
- PATTERN_ENTRY_UPDATED,
- PATTERN_ENTRY_CANT_CONDITIONALIZE,
- PATTERN_MAX,
- };
-
// Used for categorizing validation triggers in histograms.
// NOTE: This enumeration is used in histograms, so please do not add entries
// in the middle.
@@ -427,12 +410,21 @@ class HttpCache::Transaction : public HttpTransaction {
// |old_network_trans_load_timing_|, which must be NULL when this is called.
void ResetNetworkTransaction();
- // Returns true if we should bother attempting to resume this request if it
- // is aborted while in progress. If |has_data| is true, the size of the stored
+ // Returns true if we should bother attempting to resume this request if it is
+ // aborted while in progress. If |has_data| is true, the size of the stored
// data is considered for the result.
bool CanResume(bool has_data);
- void UpdateTransactionPattern(TransactionPattern new_transaction_pattern);
+ // Setter for response_ and auth_response_. It updates its cache entry status,
+ // if needed.
+ void SetResponse(const HttpResponseInfo& new_response);
+ void SetAuthResponse(const HttpResponseInfo& new_response);
+
+ void UpdateCacheEntryStatus(
+ HttpResponseInfo::CacheEntryStatus new_cache_entry_status);
+
+ // Sets the response.cache_entry_status to the current cache_entry_status_.
+ void SyncCacheEntryStatusToResponse();
void RecordHistograms();
// Called to signal completion of asynchronous IO.
@@ -479,7 +471,11 @@ class HttpCache::Transaction : public HttpTransaction {
CompletionCallback io_callback_;
// Members used to track data for histograms.
- TransactionPattern transaction_pattern_;
+ // This cache_entry_status_ takes precedence over
+ // response_.cache_entry_status. In fact, response_.cache_entry_status must be
+ // kept in sync with cache_entry_status_ (via SetResponse and
+ // UpdateCacheEntryStatus).
+ HttpResponseInfo::CacheEntryStatus cache_entry_status_;
ValidationCause validation_cause_;
base::TimeTicks entry_lock_waiting_since_;
base::TimeTicks first_cache_access_since_;
« no previous file with comments | « no previous file | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698