Index: components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc |
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc |
index b24094763c503b3a30ef59cf9ebad7ba84a9127a..70c36eaf91d38cea363ab111a8b7e34529a3efba 100644 |
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc |
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc |
@@ -198,15 +198,19 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms( |
return; |
} |
- if (triggering_request_) { |
+ if (triggering_request_ && |
bengr
2014/09/16 01:55:05
Please add a comment here that explains why we onl
megjablon
2014/09/16 17:22:40
Done.
|
+ (last_bypass_type_ == BYPASS_EVENT_TYPE_SHORT || |
+ last_bypass_type_ == BYPASS_EVENT_TYPE_MEDIUM || |
+ last_bypass_type_ == BYPASS_EVENT_TYPE_LONG)) { |
// We only record when audio or video triggers a bypass. We don't care |
// about audio and video bypassed as collateral damage. |
std::string mime_type; |
request.GetMimeType(&mime_type); |
// MIME types are named by <media-type>/<subtype>. We check to see if the |
// media type is audio or video. |
- if (mime_type.compare(0, 6, "audio/") == 0 || |
- mime_type.compare(0, 6, "video/") == 0) { |
+ if (last_bypass_type_ == BYPASS_EVENT_TYPE_SHORT && |
+ (mime_type.compare(0, 6, "audio/") == 0 || |
+ mime_type.compare(0, 6, "video/") == 0)) { |
RecordBypassedBytes(last_bypass_type_, |
DataReductionProxyUsageStats::AUDIO_VIDEO, |
content_length); |
@@ -229,9 +233,9 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms( |
if (data_reduction_proxy_params_-> |
AreDataReductionProxiesBypassed(request, NULL)) { |
- RecordBypassedBytes(last_bypass_type_, |
- DataReductionProxyUsageStats::NETWORK_ERROR, |
- content_length); |
+ RecordBypassedBytes(last_bypass_type_, |
+ DataReductionProxyUsageStats::NETWORK_ERROR, |
+ content_length); |
} |
} |