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

Unified Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 135193007: Use user specific NSSDatabase in CertLoader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/login_utils.cc
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 57df96531f530a6a7ba8eadc8d30877f4c6d45db..e518284b354e9dbb90593e6f741e87651c70e805 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -63,6 +63,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pref_names.h"
+#include "chromeos/cert_loader.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/cryptohome/cryptohome_util.h"
#include "chromeos/dbus/cryptohome_client.h"
@@ -584,10 +585,20 @@ void LoginUtilsImpl::FinalizePrepareProfile(Profile* user_profile) {
content::NotificationService::AllSources(),
content::Details<Profile>(user_profile));
- // Initialize RLZ only for primary user.
+ // Initialize RLZ and CertLoader only for primary user.
if (UserManager::Get()->GetPrimaryUser() ==
UserManager::Get()->GetUserByProfile(user_profile)) {
InitRlzDelayed(user_profile);
+
+ // CertLoader::StartWithUser must not be called before the NSS is
+ // initialized for the user. This happens during profile initialization,
+ // which should be done by now, so the CertLoader can be started at this
+ // point. The cert loader should be started woth the primary user,
+ // as it only needs to load the primary user's certificates.
+ if (CertLoader::IsInitialized()) {
tbarzic 2014/01/22 23:07:15 Do you have any suggestions for a better place to
+ const User* user = UserManager::Get()->GetPrimaryUser();
+ CertLoader::Get()->StartWithUser(user->username_hash());
mattm 2014/01/23 01:45:55 Should use GetNSSCertDatabaseForResourceContext fr
tbarzic 2014/01/23 04:45:28 Makes sense. Moved Db "creation" for the CertLoade
+ }
}
// TODO(altimofeev): This pointer should probably never be NULL, but it looks
// like LoginUtilsImpl::OnProfileCreated() may be getting called before

Powered by Google App Engine
This is Rietveld 408576698