Index: chrome/browser/profiles/profile_io_data.cc |
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc |
index 8caf7f39de4e63054fc085b2013d80cd784aff0a..2611f881e22a94c80c07c4f217fc3700bfa460a4 100644 |
--- a/chrome/browser/profiles/profile_io_data.cc |
+++ b/chrome/browser/profiles/profile_io_data.cc |
@@ -95,6 +95,10 @@ |
#include "chrome/browser/policy/profile_policy_connector_factory.h" |
#endif // defined(OS_CHROMEOS) |
+#if defined(USE_NSS) |
+#include "chrome/browser/net/nss_slot_factory.h" |
+#endif |
+ |
using content::BrowserContext; |
using content::BrowserThread; |
using content::ResourceContext; |
@@ -297,6 +301,11 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
#if defined(OS_CHROMEOS) |
params->cert_verifier = CreatePolicyCertVerifier(profile); |
#endif |
+#if defined(USE_NSS) |
+ params->public_slot = NSSSlotFactory::GetPublicSlotForBrowserContext(profile); |
+ params->private_slot = |
+ NSSSlotFactory::GetPrivateSlotForBrowserContext(profile); |
+#endif |
params->profile = profile; |
profile_params_.reset(params.release()); |
@@ -643,6 +652,16 @@ DesktopNotificationService* ProfileIOData::GetNotificationService() const { |
} |
#endif |
+#if defined(USE_NSS) |
+crypto::ScopedPK11Slot ProfileIOData::GetPublicNSSKeySlot() const { |
+ return crypto::ScopedPK11Slot(PK11_ReferenceSlot(public_slot_.get())); |
+} |
+ |
+crypto::ScopedPK11Slot ProfileIOData::GetPrivateNSSKeySlot() const { |
+ return crypto::ScopedPK11Slot(PK11_ReferenceSlot(private_slot_.get())); |
+} |
+#endif |
+ |
void ProfileIOData::InitializeMetricsEnabledStateOnUIThread() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
#if defined(OS_CHROMEOS) |
@@ -830,6 +849,10 @@ void ProfileIOData::Init(content::ProtocolHandlerMap* protocol_handlers) const { |
main_request_context_->set_cert_verifier( |
io_thread_globals->cert_verifier.get()); |
#endif |
+#if defined(USE_NSS) |
+ public_slot_ = profile_params_->public_slot.Pass(); |
+ private_slot_ = profile_params_->private_slot.Pass(); |
+#endif |
InitializeInternal(profile_params_.get(), protocol_handlers); |