File tree Expand file tree Collapse file tree 2 files changed +21
-21
lines changed
Expand file tree Collapse file tree 2 files changed +21
-21
lines changed Original file line number Diff line number Diff line change 242242#include " mozilla/mozalloc_oom.h"
243243#include " SafeMode.h"
244244
245- #ifdef MOZ_THUNDERBIRD
246- # include " nsIPK11TokenDB.h"
247- # include " nsIPK11Token.h"
248- #endif
249-
250245#ifdef MOZ_BACKGROUNDTASKS
251246# include " mozilla/BackgroundTasks.h"
252247# include " nsIPowerManagerService.h"
@@ -5017,22 +5012,6 @@ nsresult XREMain::XRE_mainRun() {
50175012
50185013 mDirProvider .DoStartup ();
50195014
5020- #ifdef MOZ_THUNDERBIRD
5021- if (Preferences::GetBool (" security.prompt_for_master_password_on_startup" ,
5022- false )) {
5023- // Prompt for the master password prior to opening application windows,
5024- // to avoid the race that triggers multiple prompts (see bug 177175).
5025- // We use this code until we have a better solution, possibly as
5026- // described in bug 177175 comment 384.
5027- nsCOMPtr<nsIPK11TokenDB> db =
5028- do_GetService (" @mozilla.org/security/pk11tokendb;1" );
5029- nsCOMPtr<nsIPK11Token> token;
5030- if (NS_SUCCEEDED(db->GetInternalKeyToken (getter_AddRefs (token)))) {
5031- Unused << token->Login (false );
5032- }
5033- }
5034- #endif
5035-
50365015 // As FilePreferences need the profile directory, we must initialize right
50375016 // here.
50385017 mozilla::FilePreferences::InitDirectoriesWhitelist ();
Original file line number Diff line number Diff line change 5151#include " mozilla/XREAppData.h"
5252#include " nsPrintfCString.h"
5353
54+ #ifdef MOZ_THUNDERBIRD
55+ # include " nsIPK11TokenDB.h"
56+ # include " nsIPK11Token.h"
57+ #endif
58+
5459#include < stdlib.h>
5560
5661#ifdef XP_WIN
@@ -980,6 +985,22 @@ nsXREDirProvider::DoStartup() {
980985 mozilla::SandboxBroker::GeckoDependentInitialize ();
981986#endif
982987
988+ #ifdef MOZ_THUNDERBIRD
989+ if (mozilla::Preferences::GetBool (
990+ " security.prompt_for_master_password_on_startup" , false )) {
991+ // Prompt for the master password prior to opening application windows,
992+ // to avoid the race that triggers multiple prompts (see bug 177175).
993+ // We use this code until we have a better solution, possibly as
994+ // described in bug 177175 comment 384.
995+ nsCOMPtr<nsIPK11TokenDB> db =
996+ do_GetService (" @mozilla.org/security/pk11tokendb;1" );
997+ nsCOMPtr<nsIPK11Token> token;
998+ if (NS_SUCCEEDED(db->GetInternalKeyToken (getter_AddRefs (token)))) {
999+ mozilla::Unused << token->Login (false );
1000+ }
1001+ }
1002+ #endif
1003+
9831004 bool initExtensionManager =
9841005#ifdef MOZ_BACKGROUNDTASKS
9851006 !mozilla::BackgroundTasks::IsBackgroundTaskMode ();
You can’t perform that action at this time.
0 commit comments