| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 } | 410 } |
| 411 | 411 |
| 412 void ResourceLoader::ContinueSSLRequest() { | 412 void ResourceLoader::ContinueSSLRequest() { |
| 413 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 413 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 414 | 414 |
| 415 DVLOG(1) << "ContinueSSLRequest() url: " << request_->url().spec(); | 415 DVLOG(1) << "ContinueSSLRequest() url: " << request_->url().spec(); |
| 416 | 416 |
| 417 request_->ContinueDespiteLastError(); | 417 request_->ContinueDespiteLastError(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) { | 420 void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert, |
| 421 net::SSLPrivateKey* private_key) { |
| 421 DCHECK(ssl_client_auth_handler_); | 422 DCHECK(ssl_client_auth_handler_); |
| 422 ssl_client_auth_handler_.reset(); | 423 ssl_client_auth_handler_.reset(); |
| 423 if (!cert) { | 424 request_->ContinueWithCertificate(cert, private_key); |
| 424 request_->ContinueWithCertificate(nullptr, nullptr); | |
| 425 return; | |
| 426 } | |
| 427 scoped_refptr<net::SSLPrivateKey> private_key = | |
| 428 net::FetchClientCertPrivateKey(cert); | |
| 429 request_->ContinueWithCertificate(cert, private_key.get()); | |
| 430 } | 425 } |
| 431 | 426 |
| 432 void ResourceLoader::CancelCertificateSelection() { | 427 void ResourceLoader::CancelCertificateSelection() { |
| 433 DCHECK(ssl_client_auth_handler_); | 428 DCHECK(ssl_client_auth_handler_); |
| 434 ssl_client_auth_handler_.reset(); | 429 ssl_client_auth_handler_.reset(); |
| 435 request_->CancelWithError(net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED); | 430 request_->CancelWithError(net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED); |
| 436 } | 431 } |
| 437 | 432 |
| 438 void ResourceLoader::Resume() { | 433 void ResourceLoader::Resume() { |
| 439 DCHECK(!is_transferring_); | 434 DCHECK(!is_transferring_); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 case net::URLRequestStatus::FAILED: | 705 case net::URLRequestStatus::FAILED: |
| 711 status = STATUS_UNDEFINED; | 706 status = STATUS_UNDEFINED; |
| 712 break; | 707 break; |
| 713 } | 708 } |
| 714 | 709 |
| 715 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 710 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
| 716 } | 711 } |
| 717 } | 712 } |
| 718 | 713 |
| 719 } // namespace content | 714 } // namespace content |
| OLD | NEW |