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

Unified Diff: net/http/http_cache_transaction.h

Issue 2113603003: Exposing CacheEntryStatus (former TransactionPattern) via UrlRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test 401 before and after Read 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') | net/http/http_cache_transaction.cc » ('J')
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..4a638dbdacfa1e7a4f9b5685210f88265d53dd0f 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.
@@ -432,7 +415,15 @@ class HttpCache::Transaction : public HttpTransaction {
// data is considered for the result.
bool CanResume(bool has_data);
- void UpdateTransactionPattern(TransactionPattern new_transaction_pattern);
+ // Setter for response_ and auth_response_.
+ void set_response(const HttpResponseInfo& new_response);
jkarlin 2016/07/21 17:25:55 SetResponse as it does a bit more than just set th
jamartin 2016/07/25 13:39:16 Done.
+ void set_auth_response(const HttpResponseInfo& new_response);
jkarlin 2016/07/21 17:25:55 SetAuthResponse
jamartin 2016/07/25 13:39:16 Done.
+
+ 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 +470,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 set_response 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') | net/http/http_cache_transaction.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698