Upload histogram data for cache state of requests.
Add a method UploadCacheStateStats() to ChromeNetworkDelegate, and a helper method CanMimeTypeBeDeltaEncoded(). UploadCacheStateStats() is responsible for four histograms:
* Net.CacheState.AllRequests, which counts the cache state of all requests;
* Net.CacheState.EncodeableRequests, which counts the cache state of requests whose mime type makes them delta-encodeable;
* Net.CacheState.AllBytes, which counts the number of bytes sent total in CACHE_STATE_NO_LONGER_VALID;
* Net.CacheState.EncodeableBytes, which counts the number of bytes sent total in CACHE_STATE_NO_LONGER_VALID whose mime type makes them delta-encodeable.
The four cache states are:
* CACHE_STATE_FROM_CACHE (requested entity is un-expired in cache)
* CACHE_STATE_STILL_VALID (requested entity is expired in cache but still valid)
* CACHE_STATE_NO_LONGER_VALID (requested entity is expired in cache and no longer valid)
* CACHE_STATE_NO_ENTRY (requested entity is not in cache)
BUG=444916
TEST=adhoc
Load a page with a lot of resources (I used http://www.cnn.com), check
chrome://histograms for Net.CacheState.*, reload the page, reload the
histograms. You should see entries in both Requests histograms, and plausible byte counts in both Bytes histograms.
Review URL: https://codereview.chromium.org/
887493002
Cr-Commit-Position: refs/heads/master@{#316019}