Fail gracefully when we can't get a texture sync handle. (bug 1207665 part 4, r=bas,vladan) a=sylvestre
☠☠ backed out by 69e3fb393cad ☠ ☠
authorDavid Anderson <dvander@alliedmods.net>
Tue, 29 Sep 2015 11:20:01 -0700
changeset 296246 1ca0650854b4d2c83d8f9c8a59298775b09605c0
parent 296245 8de4694e5a549bc1068a31d719ed261f62ad6c4a
child 296247 69e3fb393cadb76dcce0d74cc23105dc3939225b
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, vladan, sylvestre
bugs1207665
milestone43.0a2
Fail gracefully when we can't get a texture sync handle. (bug 1207665 part 4, r=bas,vladan) a=sylvestre
gfx/layers/d3d11/CompositorD3D11.cpp
toolkit/components/telemetry/Histograms.json
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -16,16 +16,17 @@
 #include "mozilla/layers/Effects.h"
 #include "nsWindowsHelpers.h"
 #include "gfxPrefs.h"
 #include "gfxCrashReporterUtils.h"
 #include "gfxVR.h"
 #include "mozilla/gfx/StackArray.h"
 
 #include "mozilla/EnumeratedArray.h"
+#include "mozilla/Telemetry.h"
 
 #include <dxgi1_2.h>
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace layers {
@@ -1352,17 +1353,20 @@ DeviceAttachmentsD3D11::InitSyncObject()
   if (FAILED(hr)) {
     return false;
   }
 
   hr = mSyncTexture->GetSharedHandle(&mSyncHandle);
   if (FAILED(hr) || !mSyncHandle) {
     gfxCriticalError() << "Failed to get SharedHandle for sync texture. Result: "
                        << hexa(hr);
-    MOZ_CRASH();
+    NS_DispatchToMainThread(NS_NewRunnableFunction([] () -> void {
+      Accumulate(Telemetry::D3D11_SYNC_HANDLE_FAILURE, 1);
+    }));
+    return false;
   }
 
   return true;
 }
 
 bool
 DeviceAttachmentsD3D11::CreateShaders()
 {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -9599,15 +9599,22 @@
     "description": "Attempt to notify ServiceWorker of push notification."
   },
   "PUSH_API_NOTIFY_REGISTRATION_LOST": {
     "alert_emails": ["push@mozilla.com"],
     "expires_in_version": "55",
     "kind": "count",
     "description": "Attempt to notify ServiceWorker of push notification resubscription."
   },
+  "D3D11_SYNC_HANDLE_FAILURE": {
+    "alert_emails": ["bschouten@mozilla.com","danderson@mozilla.com","msreckovic@mozilla.com","ashughes@mozilla.com"],
+    "expires_in_version": "50",
+    "releaseChannelCollection": "opt-out",
+    "kind": "count",
+    "description": "Number of times the D3D11 compositor failed to get a texture sync handle."
+  },
   "YOUTUBE_EMBED_SEEN": {
     "alert_emails": ["cpeterson@mozilla.com"],
     "expires_in_version": "48",
     "kind": "flag",
     "description": "Flag activated whenever a youtube flash embed is seen during a session."
   }
 }