Skip to content

Commit

Permalink
Remove legacy SourceStream::SourceTypes
Browse files Browse the repository at this point in the history
The are used in Accept-Encoding handling. The remove legacy types:

SDCH/SDCH_POSSIBLE: Sdch support has since been removed.
GZIP_FALLBACK: This used to be used when sniffing if deflate responses
  might actually be gzipped instead, but is no longer used (I believe we
  removed that logic, though may have just restructured it)
Rejected: I believe this was specifically for when Brotli wasn't
  advertised but we received Brotli responses anyways, to discourage
  sites failing to respect Accept-Encoding advertisements, though it may
  have applied to other schemes. This logic has since been removed. We
  just don't decompress when we see an unadvertised encoding, currently.
Invalid: I'm not sure if this was ever used.

The only histogram that used these enums is Net.ContentDecodingFailed2,
which expired and was removed in https://crbug.com/969974

Bug: NONE
Change-Id: Id6968b8de8254e065ad57eb7a0fdb35d600c64dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2716903
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Maksim Orlovich <morlovich@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#857189}
  • Loading branch information
Matt Menke authored and Chromium LUCI CQ committed Feb 24, 2021
1 parent a1ab8aa commit 955c490
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 42 deletions.
1 change: 0 additions & 1 deletion net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ component("net") {
"filter/gzip_source_stream.h",
"filter/source_stream.cc",
"filter/source_stream.h",
"filter/source_stream_type_list.h",
"http/alternative_service.cc",
"http/alternative_service.h",
"http/bidirectional_stream.cc",
Expand Down
10 changes: 5 additions & 5 deletions net/filter/source_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class IOBuffer;
class NET_EXPORT_PRIVATE SourceStream {
public:
enum SourceType {
#define SOURCE_STREAM_TYPE(label) TYPE_##label,
#include "net/filter/source_stream_type_list.h"
#undef SOURCE_STREAM_TYPE
// Used for UMA.
TYPE_MAX,
TYPE_BROTLI,
TYPE_DEFLATE,
TYPE_GZIP,
TYPE_UNKNOWN,
TYPE_NONE,
};

// |type| is the type of the SourceStream.
Expand Down
22 changes: 0 additions & 22 deletions net/filter/source_stream_type_list.h

This file was deleted.

14 changes: 0 additions & 14 deletions net/url_request/url_request_http_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1115,14 +1115,6 @@ std::unique_ptr<SourceStream> URLRequestHttpJob::SetUpSourceStream() {
// Request will not be canceled; though
// it is expected that user will see malformed / garbage response.
return upstream;
case SourceStream::TYPE_GZIP_FALLBACK_DEPRECATED:
case SourceStream::TYPE_SDCH_DEPRECATED:
case SourceStream::TYPE_SDCH_POSSIBLE_DEPRECATED:
case SourceStream::TYPE_REJECTED:
case SourceStream::TYPE_INVALID:
case SourceStream::TYPE_MAX:
NOTREACHED();
return nullptr;
}
}

Expand All @@ -1137,14 +1129,8 @@ std::unique_ptr<SourceStream> URLRequestHttpJob::SetUpSourceStream() {
case SourceStream::TYPE_DEFLATE:
downstream = GzipSourceStream::Create(std::move(upstream), type);
break;
case SourceStream::TYPE_GZIP_FALLBACK_DEPRECATED:
case SourceStream::TYPE_SDCH_DEPRECATED:
case SourceStream::TYPE_SDCH_POSSIBLE_DEPRECATED:
case SourceStream::TYPE_NONE:
case SourceStream::TYPE_INVALID:
case SourceStream::TYPE_REJECTED:
case SourceStream::TYPE_UNKNOWN:
case SourceStream::TYPE_MAX:
NOTREACHED();
return nullptr;
}
Expand Down

0 comments on commit 955c490

Please sign in to comment.