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

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 2451233002: Make request fail with ERR_CONTENT_DECODING_INIT_FAILED if sdch is not supported (Closed)
Patch Set: Address Matt's comment Created 4 years, 1 month 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/filter/sdch_policy_delegate.cc ('k') | net/url_request/url_request_http_job_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 types.rbegin(); 1110 types.rbegin();
1111 r_iter != types.rend(); ++r_iter) { 1111 r_iter != types.rend(); ++r_iter) {
1112 std::unique_ptr<FilterSourceStream> downstream; 1112 std::unique_ptr<FilterSourceStream> downstream;
1113 SourceStream::SourceType type = *r_iter; 1113 SourceStream::SourceType type = *r_iter;
1114 switch (type) { 1114 switch (type) {
1115 case SourceStream::TYPE_BROTLI: 1115 case SourceStream::TYPE_BROTLI:
1116 downstream = CreateBrotliSourceStream(std::move(upstream)); 1116 downstream = CreateBrotliSourceStream(std::move(upstream));
1117 break; 1117 break;
1118 case SourceStream::TYPE_SDCH: 1118 case SourceStream::TYPE_SDCH:
1119 case SourceStream::TYPE_SDCH_POSSIBLE: { 1119 case SourceStream::TYPE_SDCH_POSSIBLE: {
1120 GURL url = request()->url(); 1120 if (request()->context()->sdch_manager()) {
1121 std::unique_ptr<SdchPolicyDelegate> delegate(new SdchPolicyDelegate( 1121 GURL url = request()->url();
1122 type == SourceStream::TYPE_SDCH_POSSIBLE, this, mime_type, url, 1122 std::unique_ptr<SdchPolicyDelegate> delegate(new SdchPolicyDelegate(
1123 is_cached_content_, request()->context()->sdch_manager(), 1123 type == SourceStream::TYPE_SDCH_POSSIBLE, this, mime_type, url,
1124 std::move(dictionaries_advertised_), GetResponseCode(), 1124 is_cached_content_, request()->context()->sdch_manager(),
1125 request()->net_log())); 1125 std::move(dictionaries_advertised_), GetResponseCode(),
1126 downstream.reset(new SdchSourceStream(std::move(upstream), 1126 request()->net_log()));
1127 std::move(delegate), type)); 1127 downstream.reset(new SdchSourceStream(std::move(upstream),
1128 std::move(delegate), type));
1129 }
1128 break; 1130 break;
1129 } 1131 }
1130 case SourceStream::TYPE_GZIP: 1132 case SourceStream::TYPE_GZIP:
1131 case SourceStream::TYPE_DEFLATE: 1133 case SourceStream::TYPE_DEFLATE:
1132 case SourceStream::TYPE_GZIP_FALLBACK: 1134 case SourceStream::TYPE_GZIP_FALLBACK:
1133 downstream = GzipSourceStream::Create(std::move(upstream), type); 1135 downstream = GzipSourceStream::Create(std::move(upstream), type);
1134 break; 1136 break;
1135 case SourceStream::TYPE_NONE: 1137 case SourceStream::TYPE_NONE:
1136 case SourceStream::TYPE_INVALID: 1138 case SourceStream::TYPE_INVALID:
1137 case SourceStream::TYPE_MAX: 1139 case SourceStream::TYPE_MAX:
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 // Notify NetworkQualityEstimator. 1561 // Notify NetworkQualityEstimator.
1560 if (request()) { 1562 if (request()) {
1561 NetworkQualityEstimator* network_quality_estimator = 1563 NetworkQualityEstimator* network_quality_estimator =
1562 request()->context()->network_quality_estimator(); 1564 request()->context()->network_quality_estimator();
1563 if (network_quality_estimator) 1565 if (network_quality_estimator)
1564 network_quality_estimator->NotifyURLRequestDestroyed(*request()); 1566 network_quality_estimator->NotifyURLRequestDestroyed(*request());
1565 } 1567 }
1566 } 1568 }
1567 1569
1568 } // namespace net 1570 } // namespace net
OLDNEW
« no previous file with comments | « net/filter/sdch_policy_delegate.cc ('k') | net/url_request/url_request_http_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698