| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <dirent.h> | 5 #include <dirent.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <sys/resource.h> | 7 #include <sys/resource.h> |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 #include <sys/time.h> | 9 #include <sys/time.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 #endif | 118 #endif |
| 119 } | 119 } |
| 120 | 120 |
| 121 LinuxSandbox::~LinuxSandbox() { | 121 LinuxSandbox::~LinuxSandbox() { |
| 122 if (pre_initialized_) { | 122 if (pre_initialized_) { |
| 123 CHECK(initialize_sandbox_ran_); | 123 CHECK(initialize_sandbox_ran_); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 LinuxSandbox* LinuxSandbox::GetInstance() { | 127 LinuxSandbox* LinuxSandbox::GetInstance() { |
| 128 LinuxSandbox* instance = Singleton<LinuxSandbox>::get(); | 128 LinuxSandbox* instance = base::Singleton<LinuxSandbox>::get(); |
| 129 CHECK(instance); | 129 CHECK(instance); |
| 130 return instance; | 130 return instance; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void LinuxSandbox::PreinitializeSandbox() { | 133 void LinuxSandbox::PreinitializeSandbox() { |
| 134 CHECK(!pre_initialized_); | 134 CHECK(!pre_initialized_); |
| 135 seccomp_bpf_supported_ = false; | 135 seccomp_bpf_supported_ = false; |
| 136 #if defined(ANY_OF_AMTLU_SANITIZER) | 136 #if defined(ANY_OF_AMTLU_SANITIZER) |
| 137 // Sanitizers need to open some resources before the sandbox is enabled. | 137 // Sanitizers need to open some resources before the sandbox is enabled. |
| 138 // This should not fork, not launch threads, not open a directory. | 138 // This should not fork, not launch threads, not open a directory. |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 void LinuxSandbox::StopThreadAndEnsureNotCounted(base::Thread* thread) const { | 448 void LinuxSandbox::StopThreadAndEnsureNotCounted(base::Thread* thread) const { |
| 449 DCHECK(thread); | 449 DCHECK(thread); |
| 450 base::ScopedFD proc_fd(OpenProc(proc_fd_)); | 450 base::ScopedFD proc_fd(OpenProc(proc_fd_)); |
| 451 PCHECK(proc_fd.is_valid()); | 451 PCHECK(proc_fd.is_valid()); |
| 452 CHECK( | 452 CHECK( |
| 453 sandbox::ThreadHelpers::StopThreadAndWatchProcFS(proc_fd.get(), thread)); | 453 sandbox::ThreadHelpers::StopThreadAndWatchProcFS(proc_fd.get(), thread)); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace content | 456 } // namespace content |
| OLD | NEW |