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

Unified Diff: content/zygote/zygote_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/zygote/zygote_linux.h ('k') | content/zygote/zygote_main_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/zygote/zygote_linux.cc
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index 3fcd996194b3258d12c87112124fce9a1d9e5ff5..101ea7f00c32956c8ca438ee601fce70dbed6093 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -25,7 +25,7 @@
#include "base/pickle.h"
#include "base/posix/unix_domain_socket.h"
#include "content/common/set_process_title.h"
-#include "content/common/sandbox_methods_linux.h"
+#include "content/common/sandbox_linux.h"
#include "content/common/zygote_commands_linux.h"
#include "content/public/common/content_descriptors.h"
#include "content/public/common/zygote_fork_delegate_linux.h"
@@ -68,13 +68,9 @@ void SELinuxTransitionToTypeOrDie(const char* type) {
} // namespace
Zygote::Zygote(int sandbox_flags,
- ZygoteForkDelegate* helper,
- int proc_fd_for_seccomp)
+ ZygoteForkDelegate* helper)
: sandbox_flags_(sandbox_flags),
helper_(helper),
-#if defined(SECCOMP_SANDBOX)
- proc_fd_for_seccomp_(proc_fd_for_seccomp),
-#endif
initial_uma_sample_(0),
initial_uma_boundary_value_(0) {
if (helper_) {
@@ -423,17 +419,9 @@ base::ProcessId Zygote::ReadArgsAndFork(const Pickle& pickle,
uma_boundary_value);
if (!child_pid) {
// This is the child process.
-#if defined(SECCOMP_SANDBOX)
- if (proc_fd_for_seccomp_ >= 0) {
- if (process_type == switches::kRendererProcess &&
- SeccompSandboxEnabled()) {
- SeccompSandboxSetProcFd(proc_fd_for_seccomp_);
- } else {
- close(proc_fd_for_seccomp_);
- }
- proc_fd_for_seccomp_ = -1;
- }
-#endif
+
+ // At this point, we finally know our process type.
+ LinuxSandbox::GetInstance()->PreinitializeSandboxFinish(process_type);
close(kBrowserDescriptor); // Our socket from the browser.
if (UsingSUIDSandbox())
« no previous file with comments | « content/zygote/zygote_linux.h ('k') | content/zygote/zygote_main_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698