Bug 1134954: Disable Safe Browsing in safe mode (r=francois,sworkman)

This commit is contained in:
Monica Chew 2015-03-05 11:55:03 -08:00
Родитель edd891a0be
Коммит 47bbee1e9f
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -18,6 +18,7 @@
#include "nsIProperties.h" #include "nsIProperties.h"
#include "nsToolkitCompsCID.h" #include "nsToolkitCompsCID.h"
#include "nsIUrlClassifierUtils.h" #include "nsIUrlClassifierUtils.h"
#include "nsIXULRuntime.h"
#include "nsUrlClassifierDBService.h" #include "nsUrlClassifierDBService.h"
#include "nsUrlClassifierUtils.h" #include "nsUrlClassifierUtils.h"
#include "nsUrlClassifierProxies.h" #include "nsUrlClassifierProxies.h"
@ -1101,6 +1102,14 @@ nsUrlClassifierDBService::Init()
gUrlClassifierDbServiceLog = PR_NewLogModule("UrlClassifierDbService"); gUrlClassifierDbServiceLog = PR_NewLogModule("UrlClassifierDbService");
#endif #endif
MOZ_ASSERT(NS_IsMainThread(), "Must initialize DB service on main thread"); MOZ_ASSERT(NS_IsMainThread(), "Must initialize DB service on main thread");
nsCOMPtr<nsIXULRuntime> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
if (appInfo) {
bool inSafeMode = false;
appInfo->GetInSafeMode(&inSafeMode);
if (inSafeMode) {
return NS_ERROR_NOT_AVAILABLE;
}
}
// Retrieve all the preferences. // Retrieve all the preferences.
mCheckMalware = Preferences::GetBool(CHECK_MALWARE_PREF, mCheckMalware = Preferences::GetBool(CHECK_MALWARE_PREF,