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

Unified Diff: net/filter/filter_source_stream.cc

Issue 2753453003: Reject unadvertised encodings (Closed)
Patch Set: Extracted code for UMA reporting Created 3 years, 9 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
Index: net/filter/filter_source_stream.cc
diff --git a/net/filter/filter_source_stream.cc b/net/filter/filter_source_stream.cc
index 603bd703c8e7311744fc74e0ae868a383d0cb518..deb3af7f20b0b0653272a7d383a13431909698a3 100644
--- a/net/filter/filter_source_stream.cc
+++ b/net/filter/filter_source_stream.cc
@@ -67,6 +67,11 @@ std::string FilterSourceStream::Description() const {
return next_type_string + "," + GetTypeAsString();
}
+void FilterSourceStream::ReportContentDecodingFailed(SourceType type) {
+ UMA_HISTOGRAM_ENUMERATION("Net.ContentDecodingFailed2.FilterType", type,
+ TYPE_MAX);
+}
+
int FilterSourceStream::DoLoop(int result) {
DCHECK_NE(STATE_NONE, next_state_);
@@ -135,10 +140,8 @@ int FilterSourceStream::DoFilterData() {
DCHECK(bytes_output != 0 ||
consumed_bytes == drainable_input_buffer_->BytesRemaining());
- if (bytes_output == ERR_CONTENT_DECODING_FAILED) {
- UMA_HISTOGRAM_ENUMERATION("Net.ContentDecodingFailed2.FilterType", type(),
- TYPE_MAX);
- }
+ if (bytes_output == ERR_CONTENT_DECODING_FAILED)
+ ReportContentDecodingFailed(type());
// FilterData() is not allowed to return ERR_IO_PENDING.
DCHECK_NE(ERR_IO_PENDING, bytes_output);

Powered by Google App Engine
This is Rietveld 408576698