Bug 1521370 - Always enable WMF VPX crashguard on Nightly r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 13 Mar 2019 01:52:26 +0000
changeset 521661 ee3013ee7a6d
parent 521660 15e52cb0872d
child 521662 303a1f4c20e8
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1521370
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1521370 - Always enable WMF VPX crashguard on Nightly r=mattwoodrow There's nothing to get around it unfortunately, making firefox unusable without it. Differential Revision: https://phabricator.services.mozilla.com/D22874
gfx/src/DriverCrashGuard.cpp
--- a/gfx/src/DriverCrashGuard.cpp
+++ b/gfx/src/DriverCrashGuard.cpp
@@ -52,39 +52,39 @@ void DriverCrashGuard::InitializeIfNeede
   if (mInitialized) {
     return;
   }
 
   mInitialized = true;
   Initialize();
 }
 
-static inline bool AreCrashGuardsEnabled() {
+static inline bool AreCrashGuardsEnabled(CrashGuardType aType) {
   // Crash guard isn't supported in the GPU process since the entire
   // process is basically a crash guard.
   if (XRE_IsGPUProcess()) {
     return false;
   }
 #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.  Unless the user forces is with an environment
   // variable, which comes in handy for testing.
-  return gfxEnv::ForceCrashGuardNightly();
-#else
+  // We handle the WMFVPXVideo crash guard differently to the other and always
+  // enable it as it completely breaks playback and there's no way around it.
+  if (aType != CrashGuardType::WMFVPXVideo) {
+    return gfxEnv::ForceCrashGuardNightly();
+  }
+#endif
   // Check to see if all guards have been disabled through the environment.
-  if (gfxEnv::DisableCrashGuard()) {
-    return false;
-  }
-  return true;
-#endif
+  return !gfxEnv::DisableCrashGuard();
 }
 
 void DriverCrashGuard::Initialize() {
-  if (!AreCrashGuardsEnabled()) {
+  if (!AreCrashGuardsEnabled(mType)) {
     return;
   }
 
   // Using DriverCrashGuard off the main thread currently does not work. Under
   // e10s it could conceivably work by dispatching the IPC calls via the main
   // thread. In the parent process this would be harder. For now, we simply
   // exit early instead.
   if (!NS_IsMainThread()) {
@@ -348,25 +348,25 @@ void DriverCrashGuard::FlushPreferences(
 
   if (nsIPrefService* prefService = Preferences::GetService()) {
     static_cast<Preferences*>(prefService)->SavePrefFileBlocking();
   }
 }
 
 void DriverCrashGuard::ForEachActiveCrashGuard(
     const CrashGuardCallback& aCallback) {
-  if (!AreCrashGuardsEnabled()) {
-    // Even if guards look active (via prefs), they can be ignored if globally
-    // disabled.
-    return;
-  }
-
   for (size_t i = 0; i < NUM_CRASH_GUARD_TYPES; i++) {
     CrashGuardType type = static_cast<CrashGuardType>(i);
 
+    if (!AreCrashGuardsEnabled(type)) {
+      // Even if guards look active (via prefs), they can be ignored if globally
+      // disabled.
+      continue;
+    }
+
     nsCString prefName;
     BuildCrashGuardPrefName(type, prefName);
 
     auto status =
         static_cast<DriverInitStatus>(Preferences::GetInt(prefName.get(), 0));
     if (status != DriverInitStatus::Crashed) {
       continue;
     }