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/ssl/ssl_client_auth_handler.h" | 5 #include "content/browser/ssl/ssl_client_auth_handler.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // to outlive SSLClientAuthHandler if needbe. | 81 // to outlive SSLClientAuthHandler if needbe. |
82 class SSLClientAuthHandler::Core : public base::RefCountedThreadSafe<Core> { | 82 class SSLClientAuthHandler::Core : public base::RefCountedThreadSafe<Core> { |
83 public: | 83 public: |
84 Core(const base::WeakPtr<SSLClientAuthHandler>& handler, | 84 Core(const base::WeakPtr<SSLClientAuthHandler>& handler, |
85 scoped_ptr<net::ClientCertStore> client_cert_store, | 85 scoped_ptr<net::ClientCertStore> client_cert_store, |
86 net::SSLCertRequestInfo* cert_request_info) | 86 net::SSLCertRequestInfo* cert_request_info) |
87 : handler_(handler), | 87 : handler_(handler), |
88 client_cert_store_(std::move(client_cert_store)), | 88 client_cert_store_(std::move(client_cert_store)), |
89 cert_request_info_(cert_request_info) {} | 89 cert_request_info_(cert_request_info) {} |
90 | 90 |
91 bool has_client_cert_store() const { return client_cert_store_; } | 91 bool has_client_cert_store() const { return !!client_cert_store_; } |
92 | 92 |
93 void GetClientCerts() { | 93 void GetClientCerts() { |
94 if (client_cert_store_) { | 94 if (client_cert_store_) { |
95 // TODO(davidben): This is still a cyclical ownership where | 95 // TODO(davidben): This is still a cyclical ownership where |
96 // GetClientCerts' requirement that |client_cert_store_| remains alive | 96 // GetClientCerts' requirement that |client_cert_store_| remains alive |
97 // until the call completes is maintained by the reference held in the | 97 // until the call completes is maintained by the reference held in the |
98 // callback. | 98 // callback. |
99 client_cert_store_->GetClientCerts( | 99 client_cert_store_->GetClientCerts( |
100 *cert_request_info_, &cert_request_info_->client_certs, | 100 *cert_request_info_, &cert_request_info_->client_certs, |
101 base::Bind(&SSLClientAuthHandler::Core::DidGetClientCerts, this)); | 101 base::Bind(&SSLClientAuthHandler::Core::DidGetClientCerts, this)); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 | 197 |
198 BrowserThread::PostTask( | 198 BrowserThread::PostTask( |
199 BrowserThread::UI, FROM_HERE, | 199 BrowserThread::UI, FROM_HERE, |
200 base::Bind(&SelectCertificateOnUIThread, render_process_host_id, | 200 base::Bind(&SelectCertificateOnUIThread, render_process_host_id, |
201 render_frame_host_id, cert_request_info_, | 201 render_frame_host_id, cert_request_info_, |
202 weak_factory_.GetWeakPtr())); | 202 weak_factory_.GetWeakPtr())); |
203 } | 203 } |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
OLD | NEW |