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

Unified Diff: chrome/browser/ui/crypto_module_delegate_nss.cc

Issue 2898573002: Refactor client cert private key handling. (Closed)
Patch Set: missing include Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/crypto_module_delegate_nss.cc
diff --git a/chrome/browser/ui/crypto_module_delegate_nss.cc b/chrome/browser/ui/crypto_module_delegate_nss.cc
index 7211e8a157b00fe5c4571f72066effd70b70ebdf..27260ae53e3e93e02b96442fbc2ab4e91834fb89 100644
--- a/chrome/browser/ui/crypto_module_delegate_nss.cc
+++ b/chrome/browser/ui/crypto_module_delegate_nss.cc
@@ -17,15 +17,15 @@ namespace {
void CreateWithSlot(
chrome::CryptoModulePasswordReason reason,
const net::HostPortPair& server,
- const base::Callback<void(std::unique_ptr<ChromeNSSCryptoModuleDelegate>)>&
+ const base::Callback<void(scoped_refptr<ChromeNSSCryptoModuleDelegate>)>&
callback,
crypto::ScopedPK11Slot slot) {
if (!slot) {
- callback.Run(std::unique_ptr<ChromeNSSCryptoModuleDelegate>());
+ callback.Run(nullptr);
return;
}
- callback.Run(std::unique_ptr<ChromeNSSCryptoModuleDelegate>(
- new ChromeNSSCryptoModuleDelegate(reason, server, std::move(slot))));
+ callback.Run(base::MakeRefCounted<ChromeNSSCryptoModuleDelegate>(
+ reason, server, std::move(slot)));
}
} // namespace
@@ -48,7 +48,7 @@ void ChromeNSSCryptoModuleDelegate::CreateForResourceContext(
chrome::CryptoModulePasswordReason reason,
const net::HostPortPair& server,
content::ResourceContext* context,
- const base::Callback<void(std::unique_ptr<ChromeNSSCryptoModuleDelegate>)>&
+ const base::Callback<void(scoped_refptr<ChromeNSSCryptoModuleDelegate>)>&
callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(!callback.is_null());

Powered by Google App Engine
This is Rietveld 408576698