Bug 1276947: Environment variable to force the use of the crash guard in nightly. r?dvander
MozReview-Commit-ID: 22O5Qtd0VUZ
--- 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.