[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit cc4c8eaff8333f6a98288ab20f7586515d46bc59
Author: Nicolas Silva <nsilva@xxxxxxxxxxx>
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;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits