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.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| 11 #include "content/browser/loader/doomed_resource_handler.h" | 11 #include "content/browser/loader/doomed_resource_handler.h" |
| 12 #include "content/browser/loader/resource_loader_delegate.h" | 12 #include "content/browser/loader/resource_loader_delegate.h" |
| 13 #include "content/browser/loader/resource_request_info_impl.h" | 13 #include "content/browser/loader/resource_request_info_impl.h" |
| 14 #include "content/browser/ssl/ssl_client_auth_handler.h" | 14 #include "content/browser/ssl/ssl_client_auth_handler.h" |
| 15 #include "content/browser/ssl/ssl_manager.h" | 15 #include "content/browser/ssl/ssl_manager.h" |
| 16 #include "content/common/ssl_status_serialization.h" | 16 #include "content/common/ssl_status_serialization.h" |
| 17 #include "content/public/browser/cert_store.h" | 17 #include "content/public/browser/cert_store.h" |
| 18 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 18 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
| 19 #include "content/public/browser/site_instance.h" | 19 #include "content/public/browser/site_instance.h" |
| 20 #include "content/public/common/content_client.h" | 20 #include "content/public/common/content_client.h" |
| 21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/common/resource_response.h" | 22 #include "content/public/common/resource_response.h" |
| 23 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
| 24 #include "net/base/client_cert_store.h" | |
| 25 #include "net/base/client_cert_store_impl.h" | |
| 24 #include "net/base/load_flags.h" | 26 #include "net/base/load_flags.h" |
| 25 #include "net/http/http_response_headers.h" | 27 #include "net/http/http_response_headers.h" |
| 26 #include "webkit/appcache/appcache_interceptor.h" | 28 #include "webkit/appcache/appcache_interceptor.h" |
| 27 | 29 |
| 28 using base::TimeDelta; | 30 using base::TimeDelta; |
| 29 using base::TimeTicks; | 31 using base::TimeTicks; |
| 30 | 32 |
| 31 namespace content { | 33 namespace content { |
| 32 namespace { | 34 namespace { |
| 33 | 35 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 void ResourceLoader::OnCertificateRequested( | 264 void ResourceLoader::OnCertificateRequested( |
| 263 net::URLRequest* unused, | 265 net::URLRequest* unused, |
| 264 net::SSLCertRequestInfo* cert_info) { | 266 net::SSLCertRequestInfo* cert_info) { |
| 265 DCHECK_EQ(request_.get(), unused); | 267 DCHECK_EQ(request_.get(), unused); |
| 266 | 268 |
| 267 if (!delegate_->AcceptSSLClientCertificateRequest(this, cert_info)) { | 269 if (!delegate_->AcceptSSLClientCertificateRequest(this, cert_info)) { |
| 268 request_->Cancel(); | 270 request_->Cancel(); |
| 269 return; | 271 return; |
| 270 } | 272 } |
| 271 | 273 |
| 274 #if defined(USE_NSS) && !defined(OS_IOS) | |
| 275 scoped_ptr<net::ClientCertStore> store(new net::ClientCertStoreImpl()); | |
|
Ryan Sleevi
2013/01/29 19:59:49
Rather than creating a new object every time, you
ppi
2013/01/30 15:34:56
Sounds good, thanks! Made the pointer a member var
| |
| 276 store->GetClientCerts(*cert_info, &cert_info->client_certs); | |
| 277 #endif | |
| 278 | |
| 272 if (cert_info->client_certs.empty()) { | 279 if (cert_info->client_certs.empty()) { |
| 273 // No need to query the user if there are no certs to choose from. | 280 // No need to query the user if there are no certs to choose from. |
| 274 request_->ContinueWithCertificate(NULL); | 281 request_->ContinueWithCertificate(NULL); |
| 275 return; | 282 return; |
| 276 } | 283 } |
| 277 | 284 |
| 278 DCHECK(!ssl_client_auth_handler_) << | 285 DCHECK(!ssl_client_auth_handler_) << |
| 279 "OnCertificateRequested called with ssl_client_auth_handler pending"; | 286 "OnCertificateRequested called with ssl_client_auth_handler pending"; |
| 280 ssl_client_auth_handler_ = new SSLClientAuthHandler(request_.get(), | 287 ssl_client_auth_handler_ = new SSLClientAuthHandler(request_.get(), |
| 281 cert_info); | 288 cert_info); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 619 // we resume. | 626 // we resume. |
| 620 deferred_stage_ = DEFERRED_FINISH; | 627 deferred_stage_ = DEFERRED_FINISH; |
| 621 } | 628 } |
| 622 } | 629 } |
| 623 | 630 |
| 624 void ResourceLoader::CallDidFinishLoading() { | 631 void ResourceLoader::CallDidFinishLoading() { |
| 625 delegate_->DidFinishLoading(this); | 632 delegate_->DidFinishLoading(this); |
| 626 } | 633 } |
| 627 | 634 |
| 628 } // namespace content | 635 } // namespace content |
| OLD | NEW |