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..ab90ad11536a3f73c8566c42cb092853dc0ba2f8 100644 |
--- a/net/http/http_cache_transaction.cc |
+++ b/net/http/http_cache_transaction.cc |
@@ -238,6 +238,13 @@ void RecordNoStoreHeaderHistogram(int load_flags, |
} |
} |
+enum ExternallyConditionalizedType { |
+ EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION, |
+ EXTERNALLY_CONDITIONALIZED_CACHE_USABLE, |
+ EXTERNALLY_CONDITIONALIZED_MISMATCHED_VALIDATORS, |
+ EXTERNALLY_CONDITIONALIZED_MAX |
+}; |
+ |
} // namespace |
namespace net { |
@@ -2226,6 +2233,21 @@ 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. |
+ ExternallyConditionalizedType type = |
+ EXTERNALLY_CONDITIONALIZED_CACHE_USABLE; |
+ if (mode_ == NONE) |
+ type = EXTERNALLY_CONDITIONALIZED_MISMATCHED_VALIDATORS; |
+ else if (RequiresValidation()) |
+ type = EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION; |
+ // TODO(ricea): Add CACHE_USABLE_STALE once stale-while-revalidate CL landed. |
rvargas (doing something else)
2014/09/04 19:33:20
tiny nit: Please add an empty line above this line
Adam Rice
2014/09/05 05:49:29
Done.
|
+ // TODO(ricea): Either remove this histogram or make it permanent by M40. |
+ UMA_HISTOGRAM_ENUMERATION("HttpCache.ExternallyConditionalized", |
+ type, |
+ EXTERNALLY_CONDITIONALIZED_MAX); |
+ |
next_state_ = STATE_SEND_REQUEST; |
return OK; |
} |