From 58f3012036d13963429ba47b94c02c0447077c37 Mon Sep 17 00:00:00 2001 From: Monica Chew Date: Thu, 5 Mar 2015 11:55:03 -0800 Subject: [PATCH] Bug 1134954: Disable Safe Browsing in safe mode (r=francois,sworkman) --- .../url-classifier/nsUrlClassifierDBService.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index ac700c256d9..abdf8219771 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -18,6 +18,7 @@ #include "nsIProperties.h" #include "nsToolkitCompsCID.h" #include "nsIUrlClassifierUtils.h" +#include "nsIXULRuntime.h" #include "nsUrlClassifierDBService.h" #include "nsUrlClassifierUtils.h" #include "nsUrlClassifierProxies.h" @@ -1101,6 +1102,14 @@ nsUrlClassifierDBService::Init() gUrlClassifierDbServiceLog = PR_NewLogModule("UrlClassifierDbService"); #endif MOZ_ASSERT(NS_IsMainThread(), "Must initialize DB service on main thread"); + nsCOMPtr 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. mCheckMalware = Preferences::GetBool(CHECK_MALWARE_PREF,