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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 329723006: Determine prevalence of cache-control: no-store in main frame resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 86d5e5fb1fff831c54dc35f149a56a55cb0979df..868f97ebb6d80db68fdc3e25c3db701c8294bd13 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -317,6 +317,14 @@ webkit_blob::BlobStorageContext* GetBlobStorageContext(
return filter->blob_storage_context()->context();
}
+enum CacheStorable {
+ // A "cache-control: no-store" header was found.
+ CACHE_STORABLE_NO_STORE,
+ // No "no-store" header was found.
+ CACHE_STORABLE_STORE,
+ CACHE_STORABLE_MAX
+};
+
} // namespace
// static
@@ -769,6 +777,17 @@ void ResourceDispatcherHostImpl::DidFinishLoading(ResourceLoader* loader) {
UMA_HISTOGRAM_COUNTS_100(
"Net.CertificateTransparency.MainFrameValidSCTCount", num_valid_scts);
}
+
+ net::HttpResponseHeaders* response_headers =
+ loader->request()->response_headers();
+ if (response_headers) {
+ CacheStorable storable =
+ response_headers->HasHeaderValue("cache-control", "no-store")
+ ? CACHE_STORABLE_NO_STORE
+ : CACHE_STORABLE_STORE;
davidben 2014/06/11 16:28:01 This could also just be a boolean with UMA_HISTOGR
jkarlin 2014/06/11 16:50:06 True, that's simpler. Went with BOOLEAN.
+ UMA_HISTOGRAM_ENUMERATION(
+ "Net.MainFrameStorable", storable, CACHE_STORABLE_MAX);
+ }
} else {
if (info->GetResourceType() == ResourceType::IMAGE) {
UMA_HISTOGRAM_SPARSE_SLOWLY(
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698