Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1351)

Unified Diff: gpu/ipc/service/gpu_init.cc

Issue 2814793007: Fix --no-sandbox and --disable-gpu-sandbox on Mali. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_init.cc
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
index de7fec9b424e306890480703d7824e123350642d..4588f9aa0abda62809038b6e031df8ea93f4c518 100644
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -181,12 +181,16 @@ bool GpuInit::InitializeAndStartSandbox(const base::CommandLine& command_line) {
sandbox_helper_->PreSandboxStartup();
+ bool attempted_startsandbox = false;
#if defined(OS_LINUX)
// On Chrome OS ARM Mali, GPU driver userspace creates threads when
// initializing a GL context, so start the sandbox early.
- if (command_line.HasSwitch(switches::kGpuSandboxStartEarly))
+ if (command_line.HasSwitch(switches::kGpuSandboxStartEarly)) {
gpu_info_.sandboxed =
sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get());
+ attempted_startsandbox = true;
+ }
+
#endif // defined(OS_LINUX)
base::TimeTicks before_initialize_one_off = base::TimeTicks::Now();
@@ -258,9 +262,11 @@ bool GpuInit::InitializeAndStartSandbox(const base::CommandLine& command_line) {
watchdog_thread_ = gpu::GpuWatchdogThread::Create();
}
- if (!gpu_info_.sandboxed)
+ if (!gpu_info_.sandboxed && !attempted_startsandbox) {
gpu_info_.sandboxed =
sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get());
+ }
+
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698