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.h" | 5 #include "net/url_request/url_request.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 const GURL& url = this->url(); | 1065 const GURL& url = this->url(); |
1066 if (!url.SchemeIs("http")) | 1066 if (!url.SchemeIs("http")) |
1067 return false; | 1067 return false; |
1068 TransportSecurityState::DomainState domain_state; | 1068 TransportSecurityState::DomainState domain_state; |
1069 if (context()->transport_security_state() && | 1069 if (context()->transport_security_state() && |
1070 context()->transport_security_state()->GetDomainState( | 1070 context()->transport_security_state()->GetDomainState( |
1071 url.host(), | 1071 url.host(), |
1072 SSLConfigService::IsSNIAvailable(context()->ssl_config_service()), | 1072 SSLConfigService::IsSNIAvailable(context()->ssl_config_service()), |
1073 &domain_state) && | 1073 &domain_state) && |
1074 domain_state.ShouldUpgradeToSSL()) { | 1074 domain_state.ShouldUpgradeToSSL()) { |
1075 url_canon::Replacements<char> replacements; | 1075 url::Replacements<char> replacements; |
1076 const char kNewScheme[] = "https"; | 1076 const char kNewScheme[] = "https"; |
1077 replacements.SetScheme(kNewScheme, | 1077 replacements.SetScheme(kNewScheme, url::Component(0, strlen(kNewScheme))); |
1078 url_parse::Component(0, strlen(kNewScheme))); | |
1079 *redirect_url = url.ReplaceComponents(replacements); | 1078 *redirect_url = url.ReplaceComponents(replacements); |
1080 return true; | 1079 return true; |
1081 } | 1080 } |
1082 return false; | 1081 return false; |
1083 } | 1082 } |
1084 | 1083 |
1085 void URLRequest::NotifyAuthRequired(AuthChallengeInfo* auth_info) { | 1084 void URLRequest::NotifyAuthRequired(AuthChallengeInfo* auth_info) { |
1086 NetworkDelegate::AuthRequiredResponse rv = | 1085 NetworkDelegate::AuthRequiredResponse rv = |
1087 NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; | 1086 NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION; |
1088 auth_info_ = auth_info; | 1087 auth_info_ = auth_info; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 new base::debug::StackTrace(NULL, 0); | 1248 new base::debug::StackTrace(NULL, 0); |
1250 *stack_trace_copy = stack_trace; | 1249 *stack_trace_copy = stack_trace; |
1251 stack_trace_.reset(stack_trace_copy); | 1250 stack_trace_.reset(stack_trace_copy); |
1252 } | 1251 } |
1253 | 1252 |
1254 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1253 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1255 return stack_trace_.get(); | 1254 return stack_trace_.get(); |
1256 } | 1255 } |
1257 | 1256 |
1258 } // namespace net | 1257 } // namespace net |
OLD | NEW |