Backed out 2 changesets (bug 1270894) for build bustage
authorWes Kocher <wkocher@mozilla.com>
Mon, 09 May 2016 13:53:10 -0700
changeset 335694 ff2c2c132be933d9f3729030957869168c1437f4
parent 335693 386b19f67f2cf4737390b4d1c67712967d45f23e
child 335695 8516745ca5af9ad23b8fcf7b751f18e0bda628e5
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1270894
milestone49.0a1
backs out8c0d3d862f1410236d7abbbe388a4a1d5868fcc9
1bb479eb334cf745759e76090b7e4817110168f3
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
Backed out 2 changesets (bug 1270894) for build bustage Backed out changeset 8c0d3d862f14 (bug 1270894) Backed out changeset 1bb479eb334c (bug 1270894)
gfx/src/DriverCrashGuard.cpp
gfx/src/DriverCrashGuard.h
toolkit/content/aboutSupport.js
toolkit/content/aboutSupport.xhtml
toolkit/locales/en-US/chrome/global/aboutSupport.dtd
toolkit/locales/en-US/chrome/global/aboutSupport.properties
toolkit/modules/Troubleshoot.jsm
toolkit/modules/tests/browser/browser_Troubleshoot.js
widget/GfxInfoBase.cpp
widget/GfxInfoBase.h
widget/nsIGfxInfo.idl
--- a/gfx/src/DriverCrashGuard.cpp
+++ b/gfx/src/DriverCrashGuard.cpp
@@ -18,88 +18,69 @@
 #include "mozilla/Services.h"
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/dom/ContentChild.h"
 
 namespace mozilla {
 namespace gfx {
 
 static const size_t NUM_CRASH_GUARD_TYPES = size_t(CrashGuardType::NUM_TYPES);
-static const char* sCrashGuardNames[] = {
+static const char* sCrashGuardNames[NUM_CRASH_GUARD_TYPES] = {
   "d3d11layers",
   "d3d9video",
   "glcontext",
-  "d3d11video",
 };
-static_assert(MOZ_ARRAY_LENGTH(sCrashGuardNames) == NUM_CRASH_GUARD_TYPES,
-              "CrashGuardType updated without a name string");
-
-static inline void
-BuildCrashGuardPrefName(CrashGuardType aType, nsCString& aOutPrefName)
-{
-  MOZ_ASSERT(mType < CrashGuardType::NUM_TYPES);
-  MOZ_ASSERT(sCrashGuardNames[size_t(mType)]);
-
-  aOutPrefName.Assign("gfx.crash-guard.status.");
-  aOutPrefName.Append(sCrashGuardNames[size_t(aType)]);
-}
 
 DriverCrashGuard::DriverCrashGuard(CrashGuardType aType, dom::ContentParent* aContentParent)
  : mType(aType)
  , mMode(aContentParent ? Mode::Proxy : Mode::Normal)
  , mInitialized(false)
  , mGuardActivated(false)
  , mCrashDetected(false)
 {
-  BuildCrashGuardPrefName(aType, mStatusPref);
+  MOZ_ASSERT(mType < CrashGuardType::NUM_TYPES);
+
+  mStatusPref.Assign("gfx.crash-guard.status.");
+  mStatusPref.Append(sCrashGuardNames[size_t(mType)]);
 }
 
 void
 DriverCrashGuard::InitializeIfNeeded()
 {
   if (mInitialized) {
     return;
   }
 
   mInitialized = true;
   Initialize();
 }
 
-static inline bool
-AreCrashGuardsEnabled()
+void
+DriverCrashGuard::Initialize()
 {
 #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;
-#else
-  // Check to see if all guards have been disabled through the environment.
-  if (gfxEnv::DisableCrashGuard()) {
-    return false;
-  }
-  return true;
+  return;
 #endif
-}
-
-void
-DriverCrashGuard::Initialize()
-{
-  if (!AreCrashGuardsEnabled()) {
-    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()) {
     return;
   }
 
+  // Check to see if all guards have been disabled through the environment.
+  if (gfxEnv::DisableCrashGuard()) {
+    return;
+  }
+
   mGfxInfo = services::GetGfxInfo();
 
   if (XRE_IsContentProcess()) {
     // Ask the parent whether or not activating the guard is okay. The parent
     // won't bother if it detected a crash.
     dom::ContentChild* cc = dom::ContentChild::GetSingleton();
     cc->SendBeginDriverCrashGuard(uint32_t(mType), &mCrashDetected);
     if (mCrashDetected) {
@@ -380,41 +361,16 @@ DriverCrashGuard::FlushPreferences()
 {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   if (nsIPrefService* prefService = Preferences::GetService()) {
     prefService->SavePrefFile(nullptr);
   }
 }
 
-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);
-
-    nsCString prefName;
-    BuildCrashGuardPrefName(type, prefName);
-
-    auto status =
-      static_cast<DriverInitStatus>(Preferences::GetInt(prefName.get(), 0));
-    if (status != DriverInitStatus::Crashed) {
-      continue;
-    }
-
-    aCallback(sCrashGuardNames[i], prefName.get());
-  }
-}
-
 D3D11LayersCrashGuard::D3D11LayersCrashGuard(dom::ContentParent* aContentParent)
  : DriverCrashGuard(CrashGuardType::D3D11Layers, aContentParent)
 {
 }
 
 void
 D3D11LayersCrashGuard::Initialize()
 {
--- a/gfx/src/DriverCrashGuard.h
+++ b/gfx/src/DriverCrashGuard.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef gfx_src_DriverCrashGuard_h__
 #define gfx_src_DriverCrashGuard_h__
 
 #include "nsCOMPtr.h"
 #include "nsIGfxInfo.h"
 #include "nsIFile.h"
 #include "nsString.h"
-#include "mozilla/Function.h"
 #include <string>
 
 namespace mozilla {
 
 namespace dom {
 class ContentParent;
 } // namespace dom
 
@@ -36,20 +35,16 @@ enum class DriverInitStatus
 };
 
 enum class CrashGuardType : uint32_t
 {
   D3D11Layers,
   D3D9Video,
   GLContext,
   D3D11Video,
-  // Add new entries above this line, update the name array in
-  // DriverCrashGuard.cpp, and make sure to add an entry in
-  // ContentParent.cpp.
-
   NUM_TYPES
 };
 
 // DriverCrashGuard is used to detect crashes at graphics driver callsites.
 // 
 // If the graphics environment is unrecognized or has changed since the last
 // session, the crash guard will activate and will detect any crashes within
 // the scope of the guard object.
@@ -78,20 +73,16 @@ public:
   enum class Mode {
     // Normal operation.
     Normal,
 
     // Acting as a proxy between the parent and child process.
     Proxy
   };
 
-  typedef mozilla::function<void(const char* aName, const char* aPrefName)>
-    CrashGuardCallback;
-  static void ForEachActiveCrashGuard(const CrashGuardCallback& aCallback);
-
 protected:
   virtual void Initialize();
   virtual bool UpdateEnvironment() = 0;
   virtual void LogCrashRecovery() = 0;
   virtual void LogFeatureDisabled() = 0;
 
   // Helper functions.
   bool FeatureEnabled(int aFeature, bool aDefault=true);
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -474,40 +474,16 @@ var snapshotFormatters = {
     if (featureLog.fallbacks.length) {
       for (let fallback of featureLog.fallbacks) {
         addRow("workarounds", fallback.name, fallback.message);
       }
     } else {
       $("graphics-workarounds-tbody").style.display = "none";
     }
 
-    let crashGuards = data.crashGuards;
-    delete data.crashGuards;
-
-    if (crashGuards.length) {
-      for (let guard of crashGuards) {
-        let resetButton = $.new("button");
-        let onClickReset = (function (guard) {
-          // Note - need this wrapper until bug 449811 fixes |guard| scoping.
-          return function () {
-            Services.prefs.setIntPref(guard.prefName, 0);
-            resetButton.removeEventListener("click", onClickReset);
-            resetButton.disabled = true;
-          };
-        })(guard);
-
-        resetButton.textContent = strings.GetStringFromName("resetOnNextRestart");
-        resetButton.addEventListener("click", onClickReset);
-
-        addRow("crashguards", guard.type + "CrashGuard", [resetButton]);
-      }
-    } else {
-      $("graphics-crashguards-tbody").style.display = "none";
-    }
-
     // Now that we're done, grab any remaining keys in data and drop them into
     // the diagnostics section.
     for (let key in data) {
       addRow("diagnostics", key, data[key]);
     }
   },
 
   javaScript: function javaScript(data) {
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -337,24 +337,16 @@
         <tbody id="graphics-decisions-tbody">
           <tr>
             <th colspan="2" class="title-column">
               &aboutSupport.graphicsDecisionLogTitle;
             </th>
           </tr>
         </tbody>
 
-        <tbody id="graphics-crashguards-tbody">
-          <tr>
-            <th colspan="2" class="title-column">
-              &aboutSupport.graphicsCrashGuardsTitle;
-            </th>
-          </tr>
-        </tbody>
-
         <tbody id="graphics-workarounds-tbody">
           <tr>
             <th colspan="2" class="title-column">
               &aboutSupport.graphicsWorkaroundsTitle;
             </th>
           </tr>
         </tbody>
 
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
@@ -114,10 +114,9 @@ variant of aboutSupport.showDir.label. -
 <!ENTITY aboutSupport.restartInSafeMode.label "Restart with Add-ons Disabled…">
 
 <!ENTITY aboutSupport.graphicsFeaturesTitle "Features">
 <!ENTITY aboutSupport.graphicsDiagnosticsTitle "Diagnostics">
 <!ENTITY aboutSupport.graphicsFailureLogTitle "Failure Log">
 <!ENTITY aboutSupport.graphicsGPU1Title "GPU #1">
 <!ENTITY aboutSupport.graphicsGPU2Title "GPU #2">
 <!ENTITY aboutSupport.graphicsDecisionLogTitle "Decision Log">
-<!ENTITY aboutSupport.graphicsCrashGuardsTitle "Crash Guard Disabled Features">
 <!ENTITY aboutSupport.graphicsWorkaroundsTitle "Workarounds">
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.properties
@@ -74,21 +74,16 @@ webglRenderer = WebGL Renderer
 GPU1 = GPU #1
 GPU2 = GPU #2
 blocklistedBug = Blocklisted due to known issues
 # LOCALIZATION NOTE %1$S will be replaced with a bug number string.
 bugLink = bug %1$S
 # LOCALIZATION NOTE %1$S will be replaced with an arbitrary identifier
 # string that can be searched on DXR/MXR or grepped in the source tree.
 unknownFailure = Blocklisted; failure code %1$S
-d3d11layersCrashGuard = D3D11 Compositor
-d3d11videoCrashGuard = D3D11 Video Decoder
-d3d9videoCrashGuard = D3D9 Video Decoder
-glcontextCrashGuard = OpenGL
-resetOnNextRestart = Reset on Next Restart
 
 minLibVersions = Expected minimum version
 loadedLibVersions = Version in use
 
 hasSeccompBPF = Seccomp-BPF (System Call Filtering)
 hasSeccompTSync = Seccomp Thread Synchronization
 hasUserNamespaces = User Namespaces
 hasPrivilegedUserNamespaces = User Namespaces for privileged processes
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -469,17 +469,16 @@ var dataProviders = {
     if (failures.length) {
       data.failures = failures;
       if (failureIndices.value.length == failures.length) {
         data.indices = failureIndices.value;
       }
     }
 
     data.featureLog = gfxInfo.getFeatureLog();
-    data.crashGuards = gfxInfo.getActiveCrashGuards();
 
     completed();
   },
 
   javaScript: function javaScript(done) {
     let data = {};
     let winEnumer = Services.ww.getWindowEnumerator();
     if (winEnumer.hasMoreElements())
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -304,19 +304,16 @@ const SNAPSHOT_SCHEMA = {
           type: "array",
           items: {
             type: "string",
           },
         },
         featureLog: {
           type: "object",
         },
-        crashGuards: {
-          type: "array",
-        },
         direct2DEnabledMessage: {
           type: "array",
         },
         webglRendererMessage: {
           type: "array",
         },
       },
     },
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -29,17 +29,16 @@
 #include "nsIXULAppInfo.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/Logging.h"
 #include "gfxPrefs.h"
 #include "gfxPlatform.h"
 #include "gfxConfig.h"
-#include "DriverCrashGuard.h"
 
 #if defined(MOZ_CRASHREPORTER)
 #include "nsExceptionHandler.h"
 #endif
 
 using namespace mozilla::widget;
 using namespace mozilla;
 using mozilla::MutexAutoLock;
@@ -1333,45 +1332,16 @@ GfxInfoBase::InitFeatureObject(JSContext
     JS::Rooted<JS::Value> val(aCx, JS::ObjectValue(*obj));
     JS_SetProperty(aCx, aContainer, aName, val);
   }
 
   aOutObj.set(obj);
   return true;
 }
 
-nsresult
-GfxInfoBase::GetActiveCrashGuards(JSContext* aCx, JS::MutableHandle<JS::Value> aOut)
-{
-  JS::Rooted<JSObject*> array(aCx, JS_NewArrayObject(aCx, 0));
-  if (!array) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-  aOut.setObject(*array);
-
-  DriverCrashGuard::ForEachActiveCrashGuard([&](const char* aName,
-                                                const char* aPrefName) -> void {
-    JS::Rooted<JSObject*> obj(aCx, JS_NewPlainObject(aCx));
-    if (!obj) {
-      return;
-    }
-    if (!SetJSPropertyString(aCx, obj, "type", aName)) {
-      return;
-    }
-    if (!SetJSPropertyString(aCx, obj, "prefName", aPrefName)) {
-      return;
-    }
-    if (!AppendJSElement(aCx, array, obj)) {
-      return;
-    }
-  });
-
-  return NS_OK;
-}
-
 GfxInfoCollectorBase::GfxInfoCollectorBase()
 {
   GfxInfoBase::AddCollector(this);
 }
 
 GfxInfoCollectorBase::~GfxInfoCollectorBase()
 {
   GfxInfoBase::RemoveCollector(this);
--- a/widget/GfxInfoBase.h
+++ b/widget/GfxInfoBase.h
@@ -52,17 +52,16 @@ public:
   NS_IMETHOD GetWebGLParameter(const nsAString & aParam, nsAString & _retval) override;
 
   NS_IMETHOD GetMonitors(JSContext* cx, JS::MutableHandleValue _retval) override;
   NS_IMETHOD GetFailures(uint32_t *failureCount, int32_t** indices, char ***failures) override;
   NS_IMETHOD_(void) LogFailure(const nsACString &failure) override;
   NS_IMETHOD GetInfo(JSContext*, JS::MutableHandle<JS::Value>) override;
   NS_IMETHOD GetFeatures(JSContext*, JS::MutableHandle<JS::Value>) override;
   NS_IMETHOD GetFeatureLog(JSContext*, JS::MutableHandle<JS::Value>) override;
-  NS_IMETHOD GetActiveCrashGuards(JSContext*, JS::MutableHandle<JS::Value>) override;
 
   // Initialization function. If you override this, you must call this class's
   // version of Init first.
   // We need Init to be called separately from the constructor so we can
   // register as an observer after all derived classes have been constructed
   // and we know we have a non-zero refcount.
   // Ideally, Init() would be void-return, but the rules of
   // NS_GENERIC_FACTORY_CONSTRUCTOR_INIT require it be nsresult return.
--- a/widget/nsIGfxInfo.idl
+++ b/widget/nsIGfxInfo.idl
@@ -219,25 +219,10 @@ interface nsIGfxInfo : nsISupports
   //       "status": "<status>",
   //       "version": "<version>",
   //       "warp": true|false,           // D3D11 only.
   //       "textureSharing": true|false, // D3D11 only.
   //     }
   //   }
   [implicit_jscontext]
   jsval getFeatures();
-
-  // Returns an array listing any active crash guards.
-  //
-  //   [
-  //     {
-  //       // Type is one of "d3d11layers", "d3d9video", "glcontext",
-  //       // or "d3d11video".
-  //       "type":        "<identifier>",
-  //
-  //       // Preference that must be deleted/reset to retrigger the guard.
-  //       "prefName":    "<preference>",
-  //     }
-  //   ]
-  [implicit_jscontext]
-  jsval getActiveCrashGuards();
 };