| 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..a2d5a709c3c0f4b37606dc605666e86bbc7715be 100644
|
| --- a/net/filter/filter_source_stream.cc
|
| +++ b/net/filter/filter_source_stream.cc
|
| @@ -17,6 +17,12 @@ namespace net {
|
|
|
| namespace {
|
|
|
| +const char kDeflate[] = "deflate";
|
| +const char kGZip[] = "gzip";
|
| +const char kSdch[] = "sdch";
|
| +const char kXGZip[] = "x-gzip";
|
| +const char kBrotli[] = "br";
|
| +
|
| const size_t kBufferSize = 32 * 1024;
|
|
|
| } // namespace
|
| @@ -67,6 +73,28 @@ std::string FilterSourceStream::Description() const {
|
| return next_type_string + "," + GetTypeAsString();
|
| }
|
|
|
| +FilterSourceStream::SourceType FilterSourceStream::ParseEncodingType(
|
| + const std::string& encoding) {
|
| + if (encoding.empty()) {
|
| + return TYPE_NONE;
|
| + } else if (base::LowerCaseEqualsASCII(encoding, kBrotli)) {
|
| + return TYPE_BROTLI;
|
| + } else if (base::LowerCaseEqualsASCII(encoding, kDeflate)) {
|
| + return TYPE_DEFLATE;
|
| + } else if (base::LowerCaseEqualsASCII(encoding, kGZip) ||
|
| + base::LowerCaseEqualsASCII(encoding, kXGZip)) {
|
| + return TYPE_GZIP;
|
| + } else if (base::LowerCaseEqualsASCII(encoding, kSdch)) {
|
| + return TYPE_SDCH;
|
| + } else {
|
| + return TYPE_UNKNOWN;
|
| + }
|
| +}
|
| +
|
| +void FilterSourceStream::ReportContentDecodingRejected(SourceType type) {
|
| + UMA_HISTOGRAM_ENUMERATION("Net.ContentDecodingRejected", type, TYPE_MAX);
|
| +}
|
| +
|
| int FilterSourceStream::DoLoop(int result) {
|
| DCHECK_NE(STATE_NONE, next_state_);
|
|
|
|
|