Bug 1306327 - Remove NS_XRE_DLL_BLOCKLIST_ENABLED. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 10 Jan 2017 09:10:36 +0900
changeset 462789 8e583d30ce9816b92a180ce34b0559c7e09e04a3
parent 462788 d6d7a6e9a3d9e9bace62823719517e7cbdb2bb5e
child 462790 be999ce0e4fe0354bd2737504cca7fccf206f94e
push id41857
push userbmo:mh+mozilla@glandium.org
push dateWed, 18 Jan 2017 00:24:11 +0000
reviewersbsmedberg
bugs1306327
milestone53.0a1
Bug 1306327 - Remove NS_XRE_DLL_BLOCKLIST_ENABLED. r=bsmedberg Instead of having nsBrowserApp.cpp set a flag in XREAppData to indicate whether the DLL blocklist properly initialized, just have XRE code ask the blocklist itself.
browser/app/nsBrowserApp.cpp
toolkit/xre/nsAppRunner.cpp
xpcom/build/XREAppData.h
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -284,24 +284,16 @@ static int do_main(int argc, char* argv[
     greDir->SetNativeLeafName(NS_LITERAL_CSTRING(kOSXResourcesFolder));
 #endif
     nsCOMPtr<nsIFile> appSubdir;
     greDir->Clone(getter_AddRefs(appSubdir));
     appSubdir->Append(NS_LITERAL_STRING(kDesktopFolder));
     appData.directory = appSubdir;
   }
 
-#if defined(HAS_DLL_BLOCKLIST)
-  // The dll blocklist operates in the exe vs. xullib. Pass a flag to
-  // xullib so automated tests can check the result once the browser
-  // is up and running.
-  appData.flags |=
-    DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
-#endif
-
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
   sandbox::BrokerServices* brokerServices =
     sandboxing::GetInitializedBrokerServices();
 #if defined(MOZ_CONTENT_SANDBOX)
   if (!brokerServices) {
     Output("Couldn't initialize the broker services.\n");
     return 255;
   }
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -93,16 +93,17 @@
 
 #ifdef XP_WIN
 #include "nsIWinAppHelper.h"
 #include <windows.h>
 #include <intrin.h>
 #include <math.h>
 #include "cairo/cairo-features.h"
 #include "mozilla/WindowsVersion.h"
+#include "mozilla/WindowsDllBlocklist.h"
 #include "mozilla/mscom/MainThreadRuntime.h"
 #include "mozilla/widget/AudioSession.h"
 
 #ifndef PROCESS_DEP_ENABLE
 #define PROCESS_DEP_ENABLE 0x1
 #endif
 #endif
 
@@ -1070,18 +1071,18 @@ nsXULAppInfo::GetIsOfficial(bool* aResul
   *aResult = false;
 #endif
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsXULAppInfo::GetWindowsDLLBlocklistStatus(bool* aResult)
 {
-#if defined(XP_WIN)
-  *aResult = gAppData->flags & NS_XRE_DLL_BLOCKLIST_ENABLED;
+#if defined(HAS_DLL_BLOCKLIST)
+  *aResult = DllBlocklist_CheckStatus();
 #else
   *aResult = false;
 #endif
   return NS_OK;
 }
 
 #ifdef XP_WIN
 // Matches the enum in WinNT.h for the Vista SDK but renamed so that we can
--- a/xpcom/build/XREAppData.h
+++ b/xpcom/build/XREAppData.h
@@ -194,23 +194,16 @@ public:
 
 /**
  * Indicates whether or not the profile migrator service may be
  * invoked at startup when creating a profile.
  */
 #define NS_XRE_ENABLE_PROFILE_MIGRATOR (1 << 1)
 
 /**
- * Indicates the Windows DLL Blocklist initialized properly. For testing
- * purposes only. Set in nsBrowserApp on startup, automated tests then
- * check the result.
- */
-#define NS_XRE_DLL_BLOCKLIST_ENABLED (1 << 2)
-
-/**
  * Indicates whether or not to use Breakpad crash reporting.
  */
 #define NS_XRE_ENABLE_CRASH_REPORTER (1 << 3)
 
 /**
  * A static version of the XRE app data is compiled into the application
  * so that it is not necessary to read application.ini at startup.
  *