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

Unified Diff: content/common/sandbox_linux/sandbox_linux.cc

Issue 189313002: Implement '--gpu-sandbox-failures-nonfatal' flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « content/browser/gpu/gpu_process_host.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_linux/sandbox_linux.cc
diff --git a/content/common/sandbox_linux/sandbox_linux.cc b/content/common/sandbox_linux/sandbox_linux.cc
index a30e41c416581d872f18bf2fabaac1cea33b9e31..b912aa364d1b9fc56e577ef8a90beb957b4f507c 100644
--- a/content/common/sandbox_linux/sandbox_linux.cc
+++ b/content/common/sandbox_linux/sandbox_linux.cc
@@ -79,6 +79,14 @@ bool IsRunningTSAN() {
#endif
}
+bool IsChromeOS() {
+#if defined(OS_CHROMEOS)
+ return true;
+#else
+ return false;
+#endif
+}
+
// Try to open /proc/self/task/ with the help of |proc_fd|. |proc_fd| can be
// -1. Will return -1 on error and set errno like open(2).
int OpenProcTaskFd(int proc_fd) {
@@ -236,9 +244,9 @@ bool LinuxSandbox::StartSeccompBPF(const std::string& process_type) {
}
bool LinuxSandbox::InitializeSandboxImpl() {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
const std::string process_type =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kProcessType);
+ command_line->GetSwitchValueASCII(switches::kProcessType);
// We need to make absolutely sure that our sandbox is "sealed" before
// returning.
@@ -261,10 +269,20 @@ bool LinuxSandbox::InitializeSandboxImpl() {
// even report an error about it.
if (IsRunningTSAN())
return false;
- // The GPU process is allowed to call InitializeSandbox() with threads for
- // now, because it loads third-party libraries.
- if (process_type != switches::kGpuProcess)
+
+ bool sandbox_failure_nonfatal = false;
jln (very slow on Chromium) 2014/03/06 23:02:30 So, on non regular Linux, this will crash, no? ni
Jorge Lucangeli Obes 2014/03/07 00:29:44 Done. Was halfway done changing the name of the fl
+
+ // On Chrome OS, the GPU process is allowed to call InitializeSandbox()
+ // with threads, but only if '--gpu-sandbox-failures-nonfatal' is passed.
+ if (IsChromeOS()) {
+ sandbox_failure_nonfatal =
+ process_type == switches::kGpuProcess &&
+ command_line->HasSwitch(switches::kGpuSandboxFailuresNonfatal);
+ }
+
+ if (!sandbox_failure_nonfatal)
CHECK(false) << error_message;
jln (very slow on Chromium) 2014/03/06 23:02:30 LOG(FATAL) instead?
Jorge Lucangeli Obes 2014/03/07 00:29:44 Done.
+
LOG(ERROR) << error_message;
return false;
}
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698