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

Unified Diff: content/common/sandbox_init_linux.cc

Issue 10534049: Disable the seccomp filter GPU process sandbox by default on Chrome OS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move all GPU process checks to function, allow non-Intel GPUs in debug mode. Created 8 years, 6 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 | content/gpu/gpu_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_init_linux.cc
diff --git a/content/common/sandbox_init_linux.cc b/content/common/sandbox_init_linux.cc
index 1dd1554ff064ceaba55fdb10b49f07530b82a0e1..919a45bbfce870027e5f9d800fa7717c43ba2fdb 100644
--- a/content/common/sandbox_init_linux.cc
+++ b/content/common/sandbox_init_linux.cc
@@ -388,6 +388,17 @@ static void InstallFilter(const std::vector<struct sock_filter>& program) {
PLOG_IF(FATAL, ret != 0) << "Failed to install filter.";
}
+static bool ShouldEnableGPUSandbox() {
+ bool res = false;
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ res = !command_line.HasSwitch(switches::kDisableGpuSandbox);
+#if defined(OS_CHROMEOS)
Chris Evans 2012/06/11 20:52:23 Can you get rid of this ifdef? If we have to pull
Jorge Lucangeli Obes 2012/06/11 22:56:46 Done.
+ res = command_line.HasSwitch(switches::kEnableGpuSandbox);
+#endif
+ return res;
+}
+
} // anonymous namespace
namespace content {
@@ -401,7 +412,7 @@ void InitializeSandbox() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
if (process_type == switches::kGpuProcess &&
- command_line.HasSwitch(switches::kDisableGpuSandbox))
+ !ShouldEnableGPUSandbox())
return;
if (!CanUseSeccompFilters())
@@ -442,4 +453,3 @@ void InitializeSandbox() {
} // namespace content
#endif
-
« no previous file with comments | « no previous file | content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698