Commit 38ae900d authored by Corentin Wallez's avatar Corentin Wallez Committed by Commit Bot

Add a --enable-unsafe-webgpu flag

This flag will controls the "WebGPU" runtime enabled features that
exposes the prototype WebGPU Blink bindings.

BUG=chromium:852089

Change-Id: Id6e718f85eb05045b8b4056a16b6cb966fba3e4a
Reviewed-on: https://chromium-review.googlesource.com/1097608
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568148}
parent dadea69a
......@@ -158,6 +158,7 @@ void DeriveCommandLine(const GURL& start_url,
::switches::kDisableWebGLImageChromium,
::switches::kEnableWebGLImageChromium,
::switches::kEnableWebVR,
::switches::kEnableUnsafeWebGPU,
::switches::kDisableWebRtcHWDecoding,
::switches::kDisableWebRtcHWEncoding,
::switches::kOzonePlatform,
......
......@@ -2766,6 +2766,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableSlimmingPaintV2,
switches::kEnableThreadedCompositing,
switches::kEnableTouchDragDrop,
switches::kEnableUnsafeWebGPU,
switches::kEnableUseZoomForDSF,
switches::kEnableViewport,
switches::kEnableVtune,
......
......@@ -204,6 +204,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
else
WebRuntimeFeatures::EnableV8IdleTasks(true);
if (command_line.HasSwitch(switches::kEnableUnsafeWebGPU))
WebRuntimeFeatures::EnableWebGPU(true);
if (command_line.HasSwitch(switches::kEnableWebVR))
WebRuntimeFeatures::EnableWebVR(true);
......
......@@ -429,6 +429,9 @@ const char kEnableTracing[] = "enable-tracing";
// The filename to write the output of the test tracing to.
const char kEnableTracingOutput[] = "enable-tracing-output";
// Enables unsafe WebGPU support.
const char kEnableUnsafeWebGPU[] = "enable-unsafe-webgpu";
// Enable screen capturing support for MediaStream API.
const char kEnableUserMediaScreenCapturing[] =
"enable-usermedia-screen-capturing";
......
......@@ -135,6 +135,7 @@ CONTENT_EXPORT extern const char kEnableStrictPowerfulFeatureRestrictions[];
CONTENT_EXPORT extern const char kEnableThreadedCompositing[];
CONTENT_EXPORT extern const char kEnableTracing[];
CONTENT_EXPORT extern const char kEnableTracingOutput[];
CONTENT_EXPORT extern const char kEnableUnsafeWebGPU[];
CONTENT_EXPORT extern const char kEnableUserMediaScreenCapturing[];
CONTENT_EXPORT extern const char kEnableUseZoomForDSF[];
CONTENT_EXPORT extern const char kEnableViewport[];
......
......@@ -151,6 +151,7 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableWebBluetooth(bool);
BLINK_PLATFORM_EXPORT static void EnableWebGLDraftExtensions(bool);
BLINK_PLATFORM_EXPORT static void EnableWebGLImageChromium(bool);
BLINK_PLATFORM_EXPORT static void EnableWebGPU(bool);
BLINK_PLATFORM_EXPORT static void EnableWebNfc(bool);
BLINK_PLATFORM_EXPORT static void EnableWebShare(bool);
BLINK_PLATFORM_EXPORT static void EnableWebUsb(bool);
......
......@@ -368,6 +368,10 @@ void WebRuntimeFeatures::EnableWebShare(bool enable) {
RuntimeEnabledFeatures::SetWebShareEnabled(enable);
}
void WebRuntimeFeatures::EnableWebGPU(bool enable) {
RuntimeEnabledFeatures::SetWebGPUEnabled(enable);
}
void WebRuntimeFeatures::EnableWebVR(bool enable) {
RuntimeEnabledFeatures::SetWebVREnabled(enable);
}
......
......@@ -1319,6 +1319,15 @@
{
name: "WebGLImageChromium",
},
// WebGPU adds a large attack surface area to the GPU process and allows
// running arbitrary programs on the GPU (compute shaders), which may
// perform arbitrary read/writes of GPU memory if not properly sandboxed.
// That's why it is marked as "test" and not enabled as part of the
// --enable-experimental-web-platform-features flag.
{
name: "WebGPU",
status: "test",
},
{
name: "WebLocksAPI",
origin_trial_feature_name: "WebLocksAPI",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment