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

Side by Side Diff: chrome/browser/certificate_manager_model.cc

Issue 2600053002: net: change ImportFromPKCS12() to take a PK11SlotInfo* (Closed)
Patch Set: REBASE Created 3 years, 11 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 | « chrome/browser/certificate_manager_model.h ('k') | chrome/browser/ssl/ssl_browser_tests.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 (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 "chrome/browser/certificate_manager_model.h" 5 #include "chrome/browser/certificate_manager_model.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 case COL_EXPIRES_ON: 205 case COL_EXPIRES_ON:
206 if (!cert.valid_expiry().is_null()) 206 if (!cert.valid_expiry().is_null())
207 rv = base::TimeFormatShortDateNumeric(cert.valid_expiry()); 207 rv = base::TimeFormatShortDateNumeric(cert.valid_expiry());
208 break; 208 break;
209 default: 209 default:
210 NOTREACHED(); 210 NOTREACHED();
211 } 211 }
212 return rv; 212 return rv;
213 } 213 }
214 214
215 int CertificateManagerModel::ImportFromPKCS12(net::CryptoModule* module, 215 int CertificateManagerModel::ImportFromPKCS12(PK11SlotInfo* slot_info,
216 const std::string& data, 216 const std::string& data,
217 const base::string16& password, 217 const base::string16& password,
218 bool is_extractable) { 218 bool is_extractable) {
219 int result = cert_db_->ImportFromPKCS12(module, data, password, 219 int result = cert_db_->ImportFromPKCS12(slot_info, data,
220 is_extractable, NULL); 220 password, is_extractable, NULL);
221 if (result == net::OK) 221 if (result == net::OK)
222 Refresh(); 222 Refresh();
223 return result; 223 return result;
224 } 224 }
225 225
226 int CertificateManagerModel::ImportUserCert(const std::string& data) { 226 int CertificateManagerModel::ImportUserCert(const std::string& data) {
227 int result = cert_db_->ImportUserCert(data); 227 int result = cert_db_->ImportUserCert(data);
228 if (result == net::OK) 228 if (result == net::OK)
229 Refresh(); 229 Refresh();
230 return result; 230 return result;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( 329 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext(
330 context, did_get_cert_db_callback); 330 context, did_get_cert_db_callback);
331 331
332 // The callback is run here instead of the actual function call because of 332 // The callback is run here instead of the actual function call because of
333 // extension_certificate_provider ownership semantics, ie. ownership can only 333 // extension_certificate_provider ownership semantics, ie. ownership can only
334 // be released once. The callback will only be run once (either inside the 334 // be released once. The callback will only be run once (either inside the
335 // function above or here). 335 // function above or here).
336 if (cert_db) 336 if (cert_db)
337 did_get_cert_db_callback.Run(cert_db); 337 did_get_cert_db_callback.Run(cert_db);
338 } 338 }
OLDNEW
« no previous file with comments | « chrome/browser/certificate_manager_model.h ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698