OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |