Bug 1393392 P3 - a help funtion to record telemetry data;
MozReview-Commit-ID: ISb2CFLkbEi
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -46,16 +46,55 @@
#endif
#if defined(MOZ_WIDGET_ANDROID)
#include "mozilla/widget/AndroidUiThread.h"
#include "mozilla/layers/UiCompositorControllerChild.h"
#endif // defined(MOZ_WIDGET_ANDROID)
namespace mozilla {
+
+static void
+ReportUnblacklistingTelemetry(bool isGPUProcessCrashed,
+ bool isHWDecodingOnGPUProcess,
+ const nsCString& aD3D11BlacklistedDriver,
+ const nsCString& aD3D9BlacklistedDriver)
+{
+#ifdef XP_WIN
+ const nsCString& blacklistedDLL = !aD3D11BlacklistedDriver.IsEmpty()
+ ? aD3D11BlacklistedDriver
+ : aD3D9BlacklistedDriver;
+
+ if (!blacklistedDLL.IsEmpty()) {
+ const uint32_t type = [isHWDecodingOnGPUProcess, isGPUProcessCrashed]() {
+ if (isHWDecodingOnGPUProcess) {
+ if (!isGPUProcessCrashed) {
+ return 0;
+ }
+ else {
+ return 1;
+ }
+ }
+ else {
+ if (!isGPUProcessCrashed) {
+ return 2;
+ }
+ else {
+ return 3;
+ }
+ }
+ }();
+
+ Telemetry::Accumulate(Telemetry::VIDEO_UNBLACKINGLISTING_DXVA_DRIVER_RUNTIME_STATUS,
+ blacklistedDLL,
+ type);
+ }
+#endif // XP_WIN
+}
+
namespace gfx {
using namespace mozilla::layers;
enum class FallbackType : uint32_t
{
NONE = 0,
DECODINGDISABLED,