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

Side by Side Diff: net/filter/filter_source_stream.cc

Issue 2867693004: Snapshot of all changes to get jumbo in blink and content.
Patch Set: Exclude certain files from jumbo because of a Windows problem Created 3 years, 3 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 unified diff | Download patch
« no previous file with comments | « net/dns/dns_query.cc ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/filter/filter_source_stream.h" 5 #include "net/filter/filter_source_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
11 #include "base/numerics/safe_conversions.h" 11 #include "base/numerics/safe_conversions.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "net/base/io_buffer.h" 13 #include "net/base/io_buffer.h"
14 #include "net/base/net_errors.h" 14 #include "net/base/net_errors.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 namespace { 18 namespace {
19 19
20 const char kDeflate[] = "deflate"; 20 const char kDeflate2[] = "deflate";
21 const char kGZip[] = "gzip"; 21 const char kGZip[] = "gzip";
22 const char kSdch[] = "sdch"; 22 const char kSdch2[] = "sdch";
23 const char kXGZip[] = "x-gzip"; 23 const char kXGZip[] = "x-gzip";
24 const char kBrotli[] = "br"; 24 const char kBrotli[] = "br";
25 25
26 const size_t kBufferSize = 32 * 1024; 26 const size_t kBufferSize = 32 * 1024;
27 27
28 } // namespace 28 } // namespace
29 29
30 FilterSourceStream::FilterSourceStream(SourceType type, 30 FilterSourceStream::FilterSourceStream(SourceType type,
31 std::unique_ptr<SourceStream> upstream) 31 std::unique_ptr<SourceStream> upstream)
32 : SourceStream(type), 32 : SourceStream(type),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return GetTypeAsString(); 72 return GetTypeAsString();
73 return next_type_string + "," + GetTypeAsString(); 73 return next_type_string + "," + GetTypeAsString();
74 } 74 }
75 75
76 FilterSourceStream::SourceType FilterSourceStream::ParseEncodingType( 76 FilterSourceStream::SourceType FilterSourceStream::ParseEncodingType(
77 const std::string& encoding) { 77 const std::string& encoding) {
78 if (encoding.empty()) { 78 if (encoding.empty()) {
79 return TYPE_NONE; 79 return TYPE_NONE;
80 } else if (base::LowerCaseEqualsASCII(encoding, kBrotli)) { 80 } else if (base::LowerCaseEqualsASCII(encoding, kBrotli)) {
81 return TYPE_BROTLI; 81 return TYPE_BROTLI;
82 } else if (base::LowerCaseEqualsASCII(encoding, kDeflate)) { 82 } else if (base::LowerCaseEqualsASCII(encoding, kDeflate2)) {
83 return TYPE_DEFLATE; 83 return TYPE_DEFLATE;
84 } else if (base::LowerCaseEqualsASCII(encoding, kGZip) || 84 } else if (base::LowerCaseEqualsASCII(encoding, kGZip) ||
85 base::LowerCaseEqualsASCII(encoding, kXGZip)) { 85 base::LowerCaseEqualsASCII(encoding, kXGZip)) {
86 return TYPE_GZIP; 86 return TYPE_GZIP;
87 } else if (base::LowerCaseEqualsASCII(encoding, kSdch)) { 87 } else if (base::LowerCaseEqualsASCII(encoding, kSdch2)) {
88 return TYPE_SDCH; 88 return TYPE_SDCH;
89 } else { 89 } else {
90 return TYPE_UNKNOWN; 90 return TYPE_UNKNOWN;
91 } 91 }
92 } 92 }
93 93
94 void FilterSourceStream::ReportContentDecodingFailed(SourceType type) { 94 void FilterSourceStream::ReportContentDecodingFailed(SourceType type) {
95 UMA_HISTOGRAM_ENUMERATION("Net.ContentDecodingFailed2", type, TYPE_MAX); 95 UMA_HISTOGRAM_ENUMERATION("Net.ContentDecodingFailed2", type, TYPE_MAX);
96 } 96 }
97 97
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 output_buffer_size_ = 0; 194 output_buffer_size_ = 0;
195 195
196 base::ResetAndReturn(&callback_).Run(rv); 196 base::ResetAndReturn(&callback_).Run(rv);
197 } 197 }
198 198
199 bool FilterSourceStream::NeedMoreData() const { 199 bool FilterSourceStream::NeedMoreData() const {
200 return !upstream_end_reached_; 200 return !upstream_end_reached_;
201 } 201 }
202 202
203 } // namespace net 203 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_query.cc ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698