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

Unified Diff: content/common/sandbox_init_linux.cc

Issue 10826093: Create a LinuxSandbox class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only include the sandbox_bpf.h header on supported architectures. Created 8 years, 5 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/common/child_process_sandbox_support_impl_shm_linux.cc ('k') | content/common/sandbox_linux.h » ('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 c7066c6267a97cf949cc4e44fc81bd494df57547..b9cafa2f2bcb702ce54b7bcf4adc97538cf0e965 100644
--- a/content/common/sandbox_init_linux.cc
+++ b/content/common/sandbox_init_linux.cc
@@ -32,6 +32,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/time.h"
+#include "content/common/sandbox_linux.h"
#include "content/public/common/content_switches.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
@@ -538,23 +539,6 @@ bool InitializeBpfSandbox_x86(const CommandLine& command_line,
return true;
}
-bool InitializeLegacySandbox_x86(const CommandLine& command_line,
- const std::string& process_type) {
-#if defined(SECCOMP_SANDBOX)
- // Start the old seccomp mode 1 (sandbox/linux/seccomp-legacy).
- if (process_type == switches::kRendererProcess && SeccompSandboxEnabled()) {
- // N.b. SupportsSeccompSandbox() returns a cached result, as we already
- // called it earlier in the zygote. Thus, it is OK for us to not pass in
- // a file descriptor for "/proc".
- if (SupportsSeccompSandbox(-1)) {
- StartSeccompSandbox();
- return true;
- }
- }
-#endif
- return false;
-}
-
} // anonymous namespace
#endif // defined(__i386__) || defined(__x86_64__)
@@ -571,7 +555,7 @@ void InitializeSandbox() {
// First, try to enable seccomp-legacy.
seccomp_legacy_started =
- InitializeLegacySandbox_x86(command_line, process_type);
+ LinuxSandbox::GetInstance()->StartSeccompLegacy(process_type);
if (seccomp_legacy_started)
LogSandboxStarted("seccomp-legacy", process_type);
« no previous file with comments | « content/common/child_process_sandbox_support_impl_shm_linux.cc ('k') | content/common/sandbox_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698