Rename FeatureStatus::Crashed to CrashedInHandler. (bug 1254899 part 4, r=milan)
☠☠ backed out by df82a3088812 ☠ ☠
authorDavid Anderson <danderson@mozilla.com>
Wed, 27 Apr 2016 22:54:25 -0700
changeset 295165 21c8a7ea2b93d6f61b0ad57fc9603c41b926a444
parent 295164 64e58f9625ebb834fb232f01311bf4e17252ca6c
child 295166 d17f98a9918a4a5e69566abf73702d8adf59151d
push id75834
push userdanderson@mozilla.com
push dateThu, 28 Apr 2016 05:58:25 +0000
treeherdermozilla-inbound@f749ee384012 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmilan
bugs1254899
milestone49.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
Rename FeatureStatus::Crashed to CrashedInHandler. (bug 1254899 part 4, r=milan)
gfx/src/gfxTelemetry.cpp
gfx/src/gfxTelemetry.h
gfx/thebes/gfxWindowsPlatform.cpp
--- a/gfx/src/gfxTelemetry.cpp
+++ b/gfx/src/gfxTelemetry.cpp
@@ -11,17 +11,17 @@ namespace gfx {
 const char*
 FeatureStatusToString(FeatureStatus aStatus)
 {
   switch (aStatus) {
     case FeatureStatus::Unused:
       return "unused";
     case FeatureStatus::Unavailable:
       return "unavailable";
-    case FeatureStatus::Crashed:
+    case FeatureStatus::CrashedInHandler:
       return "crashed";
     case FeatureStatus::Blocked:
       return "blocked";
     case FeatureStatus::Blacklisted:
       return "blacklisted";
     case FeatureStatus::Failed:
       return "failed";
     case FeatureStatus::Disabled:
--- a/gfx/src/gfxTelemetry.h
+++ b/gfx/src/gfxTelemetry.h
@@ -16,18 +16,19 @@ enum class FeatureStatus
 {
   // This feature has not been requested.
   Unused,
 
   // This feature is unavailable due to Safe Mode or not being included with
   // the operating system.
   Unavailable,
 
-  // This feature crashed immediately when we tried to initialize it.
-  Crashed,
+  // This feature crashed immediately when we tried to initialize it, but we
+  // were able to recover via SEH (or something similar).
+  CrashedInHandler,
 
   // This feature was blocked for reasons outside the blacklist, such as a
   // runtime test failing.
   Blocked,
 
   // This feature has been blocked by the graphics blacklist.
   Blacklisted,
 
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -2025,17 +2025,17 @@ gfxWindowsPlatform::AttemptD3D11DeviceCr
   if (!adapter) {
     return FeatureStatus::Unavailable;
   }
 
   HRESULT hr;
   RefPtr<ID3D11Device> device;
   if (!AttemptD3D11DeviceCreationHelper(adapter, device, hr)) {
     gfxCriticalError() << "Crash during D3D11 device creation";
-    return FeatureStatus::Crashed;
+    return FeatureStatus::CrashedInHandler;
   }
 
   if (FAILED(hr) || !device) {
     gfxCriticalError() << "D3D11 device creation failed: " << hexa(hr);
     return FeatureStatus::Failed;
   }
   if (!DoesD3D11DeviceWork()) {
     return FeatureStatus::Blocked;
@@ -2086,17 +2086,17 @@ FeatureStatus
 gfxWindowsPlatform::AttemptWARPDeviceCreation()
 {
   ScopedGfxFeatureReporter reporterWARP("D3D11-WARP", gfxPrefs::LayersD3D11ForceWARP());
 
   HRESULT hr;
   RefPtr<ID3D11Device> device;
   if (!AttemptWARPDeviceCreationHelper(reporterWARP, device, hr)) {
     gfxCriticalError() << "Exception occurred initializing WARP D3D11 device!";
-    return FeatureStatus::Crashed;
+    return FeatureStatus::CrashedInHandler;
   }
 
   if (FAILED(hr) || !device) {
     // This should always succeed... in theory.
     gfxCriticalError() << "Failed to initialize WARP D3D11 device! " << hexa(hr);
     return FeatureStatus::Failed;
   }
 
@@ -2180,17 +2180,17 @@ gfxWindowsPlatform::AttemptD3D11ContentD
       return FeatureStatus::Unavailable;
     }
   }
 
   HRESULT hr;
   if (!AttemptD3D11ContentDeviceCreationHelper(adapter, hr)) {
     gfxCriticalNote << "Recovered from crash while creating a D3D11 content device";
     RecordContentDeviceFailure(TelemetryDeviceCode::Content);
-    return FeatureStatus::Crashed;
+    return FeatureStatus::CrashedInHandler;
   }
 
   if (FAILED(hr) || !mD3D11ContentDevice) {
     gfxCriticalNote << "Failed to create a D3D11 content device: " << hexa(hr);
     RecordContentDeviceFailure(TelemetryDeviceCode::Content);
     return FeatureStatus::Failed;
   }
 
@@ -2239,17 +2239,17 @@ gfxWindowsPlatform::AttemptD3D11ImageBri
 
 FeatureStatus
 gfxWindowsPlatform::AttemptD3D11ImageBridgeDeviceCreation()
 {
   HRESULT hr;
   if (!AttemptD3D11ImageBridgeDeviceCreationHelper(GetDXGIAdapter(), hr)) {
     gfxCriticalNote << "Recovered from crash while creating a D3D11 image bridge device";
     RecordContentDeviceFailure(TelemetryDeviceCode::Image);
-    return FeatureStatus::Crashed;
+    return FeatureStatus::CrashedInHandler;
   }
 
   if (FAILED(hr) || !mD3D11ImageBridgeDevice) {
     gfxCriticalNote << "Failed to create a content image bridge device: " << hexa(hr);
     RecordContentDeviceFailure(TelemetryDeviceCode::Image);
     return FeatureStatus::Failed;
   }
 
@@ -2375,17 +2375,17 @@ gfxWindowsPlatform::InitializeD3D11()
     mD3D11Status = FeatureStatus::Failed;
     return;
   }
 
   if (XRE_IsParentProcess()) {
     // First try to create a hardware accelerated device.
     if (canUseHardware) {
       mD3D11Status = AttemptD3D11DeviceCreation();
-      if (mD3D11Status == FeatureStatus::Crashed) {
+      if (mD3D11Status == FeatureStatus::CrashedInHandler) {
         return;
       }
     }
 
     // If that failed, see if we can use WARP.
     if (!mD3D11Device) {
       if (!CanUseWARP()) {
         mD3D11Status = FeatureStatus::Blocked;
@@ -2407,37 +2407,37 @@ gfxWindowsPlatform::InitializeD3D11()
     // whether the parent process is using WARP and whether or not texture
     // sharing works.
     mIsWARP = !canUseHardware;
     mCompositorD3D11TextureSharingWorks = GetParentDevicePrefs().d3d11TextureSharingWorks();
     mD3D11Status = FeatureStatus::Available;
   }
 
   if (CanUseD3D11ImageBridge()) {
-    if (AttemptD3D11ImageBridgeDeviceCreation() == FeatureStatus::Crashed) {
+    if (AttemptD3D11ImageBridgeDeviceCreation() == FeatureStatus::CrashedInHandler) {
       DisableD3D11AfterCrash();
       return;
     }
   }
 
-  if (AttemptD3D11ContentDeviceCreation() == FeatureStatus::Crashed) {
+  if (AttemptD3D11ContentDeviceCreation() == FeatureStatus::CrashedInHandler) {
     DisableD3D11AfterCrash();
     return;
   }
 
   // We leak these everywhere and we need them our entire runtime anyway, let's
   // leak it here as well. We keep the pointer to sD3D11CreateDeviceFn around
   // as well for D2D1 and device resets.
   d3d11Module.disown();
 }
 
 void
 gfxWindowsPlatform::DisableD3D11AfterCrash()
 {
-  mD3D11Status = FeatureStatus::Crashed;
+  mD3D11Status = FeatureStatus::CrashedInHandler;
   ResetD3D11Devices();
 }
 
 void
 gfxWindowsPlatform::ResetD3D11Devices()
 {
   MutexAutoLock lock(mDeviceLock);