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

Unified Diff: net/http/http_response_info.h

Issue 2113603003: Exposing CacheEntryStatus (former TransactionPattern) via UrlRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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_response_info.h
diff --git a/net/http/http_response_info.h b/net/http/http_response_info.h
index 2dce1a1de07c9577c835cfcb8b2f2ca7bbf3e5c9..2e02704fb1e87740fbea2e83295419be77d76169 100644
--- a/net/http/http_response_info.h
+++ b/net/http/http_response_info.h
@@ -44,6 +44,30 @@ class NET_EXPORT HttpResponseInfo {
NUM_OF_CONNECTION_INFOS,
};
+ // Used for categorizing transactions for reporting in histograms.
+ // CacheInfo covers relatively common use cases being measured and considered
+ // for optimization. Many use cases that are more complex or uncommon are
+ // binned as NOT_COVERED, and details are not reported.
+ // NOTE: This enumeration is used in histograms, so please do not add entries
+ // in the middle.
+ enum CacheInfo {
jkarlin 2016/06/30 19:01:12 CacheInfo is vague. How about CacheEntryStatus?
jamartin 2016/07/04 17:12:26 Done.
+ UNDEFINED,
+ // Complex or uncommon case.
+ NOT_COVERED,
+ // The response was not in the cache.
+ ENTRY_NOT_CACHED,
+ // The response was served from the cache. Implies was_cached.
+ ENTRY_USED,
+ // The response was validated and served from the cache. Implies was_cached
+ // and network_accessed.
+ ENTRY_VALIDATED,
+ // There was a stale entry in the cache that was updated.
+ ENTRY_UPDATED,
+ // The HTTP request didn't allow a conditional request.
+ ENTRY_CANT_CONDITIONALIZE,
+ MAX,
+ };
+
HttpResponseInfo();
HttpResponseInfo(const HttpResponseInfo& rhs);
~HttpResponseInfo();
@@ -75,6 +99,9 @@ class NET_EXPORT HttpResponseInfo {
// value even if the request fails.
bool was_cached;
+ // How this response was handled by the http_cache.
jkarlin 2016/06/30 19:01:12 s/http_cache/HTTP cache/
jamartin 2016/07/04 17:12:26 Done.
+ CacheInfo cache_info;
jkarlin 2016/06/30 19:01:12 similarly, prefer cache_entry_status
jamartin 2016/07/04 17:12:26 Done.
+
// True if the request was fetched from cache rather than the network
// because of a LOAD_FROM_CACHE_IF_OFFLINE flag when the system
// was unable to contact the server.

Powered by Google App Engine
This is Rietveld 408576698