Commit be9cde47 authored by Zhenyao Mo's avatar Zhenyao Mo Committed by Commit Bot

Allow loading SwiftShader after sandbox init on Mac

We could blacklist WebGL based on GL version, which is after creating a context.

Right now this will trigger a failure and GPU process will exit and then
relaunch with SwiftShader mode, which pre-load SwiftShader before sandbox init.

So users will not notice, but this GPU process exit and relaunch is less optimal
and unnecessary.

BUG=897914
TEST=manual
R=kerrnel@chromium.org,kbr@chromium.org,sugoi@chromium.org

Change-Id: Idcd018ca1f2e5161002cdae4563462c76316c606
Reviewed-on: https://chromium-review.googlesource.com/c/1297481Reviewed-by: default avatarAlexis Hétu <sugoi@chromium.org>
Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602391}
parent 642ddb55
...@@ -12,6 +12,3 @@ class GpuProcessExpectations(GpuTestExpectations): ...@@ -12,6 +12,3 @@ class GpuProcessExpectations(GpuTestExpectations):
# Seems to have become flaky on Windows recently. # Seems to have become flaky on Windows recently.
self.Flaky('GpuProcess_one_extra_workaround', ['win'], bug=700522) self.Flaky('GpuProcess_one_extra_workaround', ['win'], bug=700522)
self.Fail('GpuProcess_feature_status_under_swiftshader',
['mac'], bug=897914)
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
(allow file-read* (extension "com.apple.app-sandbox.read")) (allow file-read* (extension "com.apple.app-sandbox.read"))
; Allow to read framework and CDM resources files for CDM host verification ; Allow to read framework and CDM resources files for CDM host verification
(define bundle-version-path "BUNDLE_VERSION_PATH")
(allow file-read* (subpath (param bundle-version-path))) (allow file-read* (subpath (param bundle-version-path)))
; mach IPC ; mach IPC
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
(define (param-defined? str) (string? (param str))) (define (param-defined? str) (string? (param str)))
; Define constants for all of the parameter strings passed in. ; Define constants for all of the parameter strings passed in.
(define bundle-version-path "BUNDLE_VERSION_PATH")
(define disable-sandbox-denial-logging "DISABLE_SANDBOX_DENIAL_LOGGING") (define disable-sandbox-denial-logging "DISABLE_SANDBOX_DENIAL_LOGGING")
(define enable-logging "ENABLE_LOGGING") (define enable-logging "ENABLE_LOGGING")
(define homedir-as-literal "USER_HOMEDIR_AS_LITERAL") (define homedir-as-literal "USER_HOMEDIR_AS_LITERAL")
......
...@@ -29,3 +29,6 @@ ...@@ -29,3 +29,6 @@
; Needed for VideoToolbox usage - https://crbug.com/767037 ; Needed for VideoToolbox usage - https://crbug.com/767037
(allow mach-lookup (global-name "com.apple.coremedia.videodecoder")) (allow mach-lookup (global-name "com.apple.coremedia.videodecoder"))
; Needed for GPU process to fallback to SwiftShader - https://crbug.com/897914
(allow file-read-data file-read-metadata (subpath (param bundle-version-path)))
...@@ -242,7 +242,8 @@ bool SandboxMac::Enable(SandboxType sandbox_type) { ...@@ -242,7 +242,8 @@ bool SandboxMac::Enable(SandboxType sandbox_type) {
if (!compiler.InsertBooleanParam(kSandboxMacOS1013, macos_1013)) if (!compiler.InsertBooleanParam(kSandboxMacOS1013, macos_1013))
return false; return false;
if (sandbox_type == service_manager::SANDBOX_TYPE_CDM) { if (sandbox_type == service_manager::SANDBOX_TYPE_CDM ||
sandbox_type == service_manager::SANDBOX_TYPE_GPU) {
base::FilePath bundle_path = SandboxMac::GetCanonicalPath( base::FilePath bundle_path = SandboxMac::GetCanonicalPath(
base::mac::FrameworkBundlePath().DirName()); base::mac::FrameworkBundlePath().DirName());
if (!compiler.InsertStringParam(kSandboxBundleVersionPath, if (!compiler.InsertStringParam(kSandboxBundleVersionPath,
......
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