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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 18121007: *WIP* Store NSS slots per profile. Move keygen to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 0a0d95b4df8e9372d2417a6caefb0db44a57d967..e95dfcf7815d4950abadc018048c5626b863f9ef 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -91,6 +91,10 @@
#include "chrome/browser/policy/browser_policy_connector.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;
@@ -276,6 +280,12 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
g_browser_process->browser_policy_connector();
params->trust_anchor_provider = connector->GetCertTrustAnchorProvider();
#endif
+#if defined(USE_NSS)
+ params->public_slot =
+ chrome::NSSSlotFactory::GetPublicSlotForBrowserContext(profile);
+ params->private_slot =
+ chrome::NSSSlotFactory::GetPrivateSlotForBrowserContext(profile);
+#endif
params->profile = profile;
profile_params_.reset(params.release());
@@ -560,6 +570,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)
@@ -720,6 +740,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);

Powered by Google App Engine
This is Rietveld 408576698