[tbb-commits] [tor-browser/tor-browser-91.7.0esr-11.5-1] Bug 1758156 - Check the pref when creating PWebGPU parent actors. r=aosmond a=pascalc

boklm at torproject.org boklm at torproject.org
Mon Mar 14 16:25:37 UTC 2022


commit 6629b12fa039847d891032f558853dccca2c0b63
Author: Nicolas Silva <nsilva at mozilla.com>
Date:   Thu Mar 10 10:41:29 2022 +0000

    Bug 1758156 - Check the pref when creating PWebGPU parent actors. r=aosmond a=pascalc
    
    Differential Revision: https://phabricator.services.mozilla.com/D140539
---
 gfx/layers/ipc/ContentCompositorBridgeParent.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp
index 6cbfbe206863..bfbf49a93ab7 100644
--- a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp
@@ -15,6 +15,7 @@
 #  include "mozilla/gfx/DeviceManagerDx.h"  // for DeviceManagerDx
 #  include "mozilla/layers/ImageDataSerializer.h"
 #endif
+#include "mozilla/StaticPrefs_dom.h"
 #include "mozilla/dom/WebGLParent.h"
 #include "mozilla/ipc/Transport.h"           // for Transport
 #include "mozilla/layers/AnimationHelper.h"  // for CompositorAnimationStorage
@@ -270,6 +271,10 @@ bool ContentCompositorBridgeParent::DeallocPWebRenderBridgeParent(
 }
 
 webgpu::PWebGPUParent* ContentCompositorBridgeParent::AllocPWebGPUParent() {
+  if (!StaticPrefs::dom_webgpu_enabled()) {
+    return nullptr;
+  }
+
   webgpu::WebGPUParent* parent = new webgpu::WebGPUParent();
   parent->AddRef();  // IPDL reference
   return parent;


More information about the tbb-commits mailing list