Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: net/ssl/client_cert_store_nss.cc

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/ssl/channel_id_store.cc ('k') | net/ssl/default_channel_id_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ssl/client_cert_store_nss.h" 5 #include "net/ssl/client_cert_store_nss.h"
6 6
7 #include <nss.h> 7 #include <nss.h>
8 #include <ssl.h> 8 #include <ssl.h>
9 #include <utility>
9 10
10 #include "base/bind.h" 11 #include "base/bind.h"
11 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
12 #include "base/location.h" 13 #include "base/location.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
15 #include "base/strings/string_piece.h" 16 #include "base/strings/string_piece.h"
16 #include "base/threading/worker_pool.h" 17 #include "base/threading/worker_pool.h"
17 #include "crypto/nss_crypto_module_delegate.h" 18 #include "crypto/nss_crypto_module_delegate.h"
18 #include "net/cert/x509_util.h" 19 #include "net/cert/x509_util.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 111
111 std::sort(filtered_certs->begin(), filtered_certs->end(), 112 std::sort(filtered_certs->begin(), filtered_certs->end(),
112 x509_util::ClientCertSorter()); 113 x509_util::ClientCertSorter());
113 } 114 }
114 115
115 void ClientCertStoreNSS::GetAndFilterCertsOnWorkerThread( 116 void ClientCertStoreNSS::GetAndFilterCertsOnWorkerThread(
116 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> password_delegate, 117 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> password_delegate,
117 const SSLCertRequestInfo* request, 118 const SSLCertRequestInfo* request,
118 CertificateList* selected_certs) { 119 CertificateList* selected_certs) {
119 CertificateList platform_certs; 120 CertificateList platform_certs;
120 GetPlatformCertsOnWorkerThread(password_delegate.Pass(), &platform_certs); 121 GetPlatformCertsOnWorkerThread(std::move(password_delegate), &platform_certs);
121 FilterCertsOnWorkerThread(platform_certs, *request, true, selected_certs); 122 FilterCertsOnWorkerThread(platform_certs, *request, true, selected_certs);
122 } 123 }
123 124
124 // static 125 // static
125 void ClientCertStoreNSS::GetPlatformCertsOnWorkerThread( 126 void ClientCertStoreNSS::GetPlatformCertsOnWorkerThread(
126 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> password_delegate, 127 scoped_ptr<crypto::CryptoModuleBlockingPasswordDelegate> password_delegate,
127 net::CertificateList* certs) { 128 net::CertificateList* certs) {
128 CERTCertList* found_certs = 129 CERTCertList* found_certs =
129 CERT_FindUserCertsByUsage(CERT_GetDefaultCertDB(), certUsageSSLClient, 130 CERT_FindUserCertsByUsage(CERT_GetDefaultCertDB(), certUsageSSLClient,
130 PR_FALSE, PR_FALSE, password_delegate.get()); 131 PR_FALSE, PR_FALSE, password_delegate.get());
131 if (!found_certs) { 132 if (!found_certs) {
132 DVLOG(2) << "No client certs found."; 133 DVLOG(2) << "No client certs found.";
133 return; 134 return;
134 } 135 }
135 for (CERTCertListNode* node = CERT_LIST_HEAD(found_certs); 136 for (CERTCertListNode* node = CERT_LIST_HEAD(found_certs);
136 !CERT_LIST_END(node, found_certs); node = CERT_LIST_NEXT(node)) { 137 !CERT_LIST_END(node, found_certs); node = CERT_LIST_NEXT(node)) {
137 certs->push_back(X509Certificate::CreateFromHandle( 138 certs->push_back(X509Certificate::CreateFromHandle(
138 node->cert, X509Certificate::OSCertHandles())); 139 node->cert, X509Certificate::OSCertHandles()));
139 } 140 }
140 CERT_DestroyCertList(found_certs); 141 CERT_DestroyCertList(found_certs);
141 } 142 }
142 143
143 } // namespace net 144 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/channel_id_store.cc ('k') | net/ssl/default_channel_id_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698