Bug 1306327 - Remove NS_XRE_DLL_BLOCKLIST_ENABLED. r=bsmedberg draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 10 Jan 2017 09:10:36 +0900
changeset 462686 460c6ca73883c3419dafba637a1aaec4fd3a162e
parent 462685 701256c317eb43be7a1bf7a76b2a47823a6bc05b
child 462687 10ff45959ace3ec64991b435927e7ba936c87d99
push id41842
push userbmo:mh+mozilla@glandium.org
push dateTue, 17 Jan 2017 22:08:05 +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.
  *