Bug 1276947: Environment variable to force the use of the crash guard in nightly. r?dvander draft
authorMilan Sreckovic <milan@mozilla.com>
Tue, 31 May 2016 10:13:08 -0400
changeset 373250 5cbc4f55da047128010b5890b7289478f10d20fe
parent 373211 864cdd00360cdf62ea5132a457ee53a17f9e31aa
child 522364 142c8fb6113af3c9af370aa86c0d1b3aa8de7eca
push id19720
push usermsreckovic@mozilla.com
push dateTue, 31 May 2016 14:32:37 +0000
reviewersdvander
bugs1276947
milestone49.0a1
Bug 1276947: Environment variable to force the use of the crash guard in nightly. r?dvander MozReview-Commit-ID: 22O5Qtd0VUZ
gfx/src/DriverCrashGuard.cpp
gfx/thebes/gfxEnv.h
--- a/gfx/src/DriverCrashGuard.cpp
+++ b/gfx/src/DriverCrashGuard.cpp
@@ -64,18 +64,19 @@ DriverCrashGuard::InitializeIfNeeded()
 }
 
 static inline bool
 AreCrashGuardsEnabled()
 {
 #ifdef NIGHTLY_BUILD
   // We only use the crash guard on non-nightly channels, since the nightly
   // channel is for development and having graphics features perma-disabled
-  // is rather annoying.
-  return false;
+  // is rather annoying.  Unless the user forces is with an environment
+  // variable, which comes in handy for testing.
+  return gfxEnv::ForceCrashGuardNightly();
 #else
   // Check to see if all guards have been disabled through the environment.
   if (gfxEnv::DisableCrashGuard()) {
     return false;
   }
   return true;
 #endif
 }
--- a/gfx/thebes/gfxEnv.h
+++ b/gfx/thebes/gfxEnv.h
@@ -42,16 +42,17 @@ public:
   // OpenGL shader debugging in OGLShaderProgram, in DEBUG only
   DECL_GFX_ENV_LIVE("MOZ_DEBUG_SHADERS", DebugShaders);
 
   // Disabling context sharing in GLContextProviderGLX
   DECL_GFX_ENV_ONCE("MOZ_DISABLE_CONTEXT_SHARING_GLX", DisableContextSharingGlx);
 
   // Disabling the crash guard in DriverCrashGuard
   DECL_GFX_ENV_ONCE("MOZ_DISABLE_CRASH_GUARD", DisableCrashGuard);
+  DECL_GFX_ENV_ONCE("MOZ_FORCE_CRASH_GUARD_NIGHTLY", ForceCrashGuardNightly);
 
   // We force present to work around some Windows bugs - disable that if this
   // environment variable is set.
   DECL_GFX_ENV_ONCE("MOZ_DISABLE_FORCE_PRESENT", DisableForcePresent);
 
   // Together with paint dumping, only when MOZ_DUMP_PAINTING is defined.
   // Dumping compositor textures is broken pretty badly. For example,
   // on Linux it crashes TextureHost::GetAsSurface() returns null.