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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 replacements.SetSchemeStr( | 204 replacements.SetSchemeStr( |
205 url.SchemeIs(url::kHttpScheme) ? url::kHttpsScheme : url::kWssScheme); | 205 url.SchemeIs(url::kHttpScheme) ? url::kHttpsScheme : url::kWssScheme); |
206 return new URLRequestRedirectJob( | 206 return new URLRequestRedirectJob( |
207 request, network_delegate, url.ReplaceComponents(replacements), | 207 request, network_delegate, url.ReplaceComponents(replacements), |
208 // Use status code 307 to preserve the method, so POST requests work. | 208 // Use status code 307 to preserve the method, so POST requests work. |
209 URLRequestRedirectJob::REDIRECT_307_TEMPORARY_REDIRECT, "HSTS"); | 209 URLRequestRedirectJob::REDIRECT_307_TEMPORARY_REDIRECT, "HSTS"); |
210 } | 210 } |
211 | 211 |
212 #if defined(OS_ANDROID) | 212 #if defined(OS_ANDROID) |
213 // Check whether the app allows cleartext traffic to this host, and return | 213 // Check whether the app allows cleartext traffic to this host, and return |
214 // ERR_BLOCKED_BY_CLIENT if not. | 214 // ERR_CLEARTEXT_NOT_PERMITTED if not. |
215 if (request->context()->check_cleartext_permitted() && | 215 if (request->context()->check_cleartext_permitted() && |
216 !android::IsCleartextPermitted(url.host())) { | 216 !android::IsCleartextPermitted(url.host())) { |
217 return new URLRequestErrorJob(request, network_delegate, | 217 return new URLRequestErrorJob(request, network_delegate, |
218 ERR_CLEARTEXT_NOT_PERMITTED); | 218 ERR_CLEARTEXT_NOT_PERMITTED); |
219 } | 219 } |
220 #endif | 220 #endif |
221 } | 221 } |
222 | 222 |
223 return new URLRequestHttpJob(request, | 223 return new URLRequestHttpJob(request, |
224 network_delegate, | 224 network_delegate, |
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 awaiting_callback_ = false; | 1554 awaiting_callback_ = false; |
1555 | 1555 |
1556 // Notify NetworkQualityEstimator. | 1556 // Notify NetworkQualityEstimator. |
1557 NetworkQualityEstimator* network_quality_estimator = | 1557 NetworkQualityEstimator* network_quality_estimator = |
1558 request()->context()->network_quality_estimator(); | 1558 request()->context()->network_quality_estimator(); |
1559 if (network_quality_estimator) | 1559 if (network_quality_estimator) |
1560 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1560 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
1561 } | 1561 } |
1562 | 1562 |
1563 } // namespace net | 1563 } // namespace net |
OLD | NEW |