Chromium Code Reviews| 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 "content/browser/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 | 232 |
| 233 void ResourceLoader::OnAuthRequired(net::URLRequest* unused, | 233 void ResourceLoader::OnAuthRequired(net::URLRequest* unused, |
| 234 net::AuthChallengeInfo* auth_info) { | 234 net::AuthChallengeInfo* auth_info) { |
| 235 DCHECK_EQ(request_.get(), unused); | 235 DCHECK_EQ(request_.get(), unused); |
| 236 | 236 |
| 237 if (request_->load_flags() & net::LOAD_DO_NOT_PROMPT_FOR_LOGIN) { | 237 if (request_->load_flags() & net::LOAD_DO_NOT_PROMPT_FOR_LOGIN) { |
| 238 request_->CancelAuth(); | 238 request_->CancelAuth(); |
| 239 return; | 239 return; |
| 240 } | 240 } |
| 241 | 241 |
| 242 if (!delegate_->AcceptAuthRequest(this, auth_info)) { | |
| 243 request_->CancelAuth(); | |
| 244 return; | |
| 245 } | |
| 246 | |
| 247 // Create a login dialog on the UI thread to get authentication data, or pull | 242 // Create a login dialog on the UI thread to get authentication data, or pull |
| 248 // from cache and continue on the IO thread. | 243 // from cache and continue on the IO thread. |
| 249 | 244 |
| 250 DCHECK(!login_delegate_.get()) | 245 DCHECK(!login_delegate_.get()) |
| 251 << "OnAuthRequired called with login_delegate pending"; | 246 << "OnAuthRequired called with login_delegate pending"; |
| 252 login_delegate_ = delegate_->CreateLoginDelegate(this, auth_info); | 247 login_delegate_ = delegate_->CreateLoginDelegate(this, auth_info); |
| 253 if (!login_delegate_.get()) | 248 if (!login_delegate_.get()) |
| 254 request_->CancelAuth(); | 249 request_->CancelAuth(); |
| 255 } | 250 } |
| 256 | 251 |
| 257 void ResourceLoader::OnCertificateRequested( | 252 void ResourceLoader::OnCertificateRequested( |
| 258 net::URLRequest* unused, | 253 net::URLRequest* unused, |
| 259 net::SSLCertRequestInfo* cert_info) { | 254 net::SSLCertRequestInfo* cert_info) { |
| 260 DCHECK_EQ(request_.get(), unused); | 255 DCHECK_EQ(request_.get(), unused); |
| 261 | 256 |
| 262 if (!delegate_->AcceptSSLClientCertificateRequest(this, cert_info)) { | 257 if (request_->load_flags() & net::LOAD_PREFETCH) { |
|
jam
2014/01/03 23:22:10
I moved this check to the content layer since cont
| |
| 263 request_->Cancel(); | 258 request_->Cancel(); |
| 264 return; | 259 return; |
| 265 } | 260 } |
| 266 | 261 |
| 267 DCHECK(!ssl_client_auth_handler_.get()) | 262 DCHECK(!ssl_client_auth_handler_.get()) |
| 268 << "OnCertificateRequested called with ssl_client_auth_handler pending"; | 263 << "OnCertificateRequested called with ssl_client_auth_handler pending"; |
| 269 ssl_client_auth_handler_ = new SSLClientAuthHandler( | 264 ssl_client_auth_handler_ = new SSLClientAuthHandler( |
| 270 GetRequestInfo()->GetContext()->CreateClientCertStore(), | 265 GetRequestInfo()->GetContext()->CreateClientCertStore(), |
| 271 request_.get(), | 266 request_.get(), |
| 272 cert_info); | 267 cert_info); |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 664 case net::URLRequestStatus::FAILED: | 659 case net::URLRequestStatus::FAILED: |
| 665 status = STATUS_UNDEFINED; | 660 status = STATUS_UNDEFINED; |
| 666 break; | 661 break; |
| 667 } | 662 } |
| 668 | 663 |
| 669 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 664 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
| 670 } | 665 } |
| 671 } | 666 } |
| 672 | 667 |
| 673 } // namespace content | 668 } // namespace content |
| OLD | NEW |