Index: net/http/http_cache_transaction.cc |
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc |
index edc638905881acc3c46af34049c109050a37ea70..46d9b848cbf2c485ce189c5348071b35e694c150 100644 |
--- a/net/http/http_cache_transaction.cc |
+++ b/net/http/http_cache_transaction.cc |
@@ -238,6 +238,22 @@ void RecordNoStoreHeaderHistogram(int load_flags, |
} |
} |
+// TODO(ricea): Add CACHE_USABLE_STALE once stale-while-revalidate CL landed. |
+// TODO(ricea): Either remove this histogram or make it permanent by M40. |
+void RecordExternallyConditionalizedHistogram(bool requires_validation) { |
+ enum ExternallyConditionalizedType { |
+ EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION, |
+ EXTERNALLY_CONDITIONALIZED_CACHE_USABLE, |
+ EXTERNALLY_CONDITIONALIZED_MAX |
+ }; |
+ ExternallyConditionalizedType type = |
+ requires_validation ? EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION |
+ : EXTERNALLY_CONDITIONALIZED_CACHE_USABLE; |
+ UMA_HISTOGRAM_ENUMERATION("HttpCache.ExternallyConditionalized", |
+ type, |
+ EXTERNALLY_CONDITIONALIZED_MAX); |
+} |
+ |
} // namespace |
namespace net { |
@@ -2226,6 +2242,11 @@ int HttpCache::Transaction::BeginExternallyConditionalizedRequest() { |
} |
} |
+ // TODO(ricea): This calculation is expensive to perform just to collect |
+ // statistics. Either remove it or use the result, depending on the result of |
+ // the experiment. |
+ RecordExternallyConditionalizedHistogram(RequiresValidation()); |
+ |
next_state_ = STATE_SEND_REQUEST; |
return OK; |
} |