From 48a5372923cb172599e0c6370697929a62a51b05 Mon Sep 17 00:00:00 2001 From: "Myles C. Maxfield" Date: Tue, 9 May 2023 14:33:07 -0700 Subject: [PATCH] [WebGPU] Disable getContext("webgpu") when WebGPU is disabled https://bugs.webkit.org/show_bug.cgi?id=256533 rdar://109106604 Reviewed by Mike Wyrzykowski, Dan Glastonbury and Tadeu Zagallo. navigator.gpu is disabled, but getContext("webgpu") isn't. * Source/WebCore/page/Navigator.cpp: (WebCore::Navigator::gpu): Canonical link: https://commits.webkit.org/263877@main --- Source/WebCore/page/Navigator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/WebCore/page/Navigator.cpp b/Source/WebCore/page/Navigator.cpp index c90d8d577f37..987f3aa3e2ae 100644 --- a/Source/WebCore/page/Navigator.cpp +++ b/Source/WebCore/page/Navigator.cpp @@ -366,6 +366,8 @@ GPU* Navigator::gpu() auto* frame = this->frame(); if (!frame) return nullptr; + if (!frame->settings().webGPU()) + return nullptr; auto* page = frame->page(); if (!page) return nullptr;