| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/sandbox_linux/bpf_gpu_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // SetProcessTitleFromCommandLine in content_main_runner.cc, so we can pass | 158 // SetProcessTitleFromCommandLine in content_main_runner.cc, so we can pass |
| 159 // NULL here (we don't have the original argv at this point). | 159 // NULL here (we don't have the original argv at this point). |
| 160 SetProcessTitleFromCommandLine(NULL); | 160 SetProcessTitleFromCommandLine(NULL); |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool UpdateProcessTypeAndEnableSandbox( | 163 bool UpdateProcessTypeAndEnableSandbox( |
| 164 sandbox::bpf_dsl::Policy* (*broker_sandboxer_allocator)(void)) { | 164 sandbox::bpf_dsl::Policy* (*broker_sandboxer_allocator)(void)) { |
| 165 DCHECK(broker_sandboxer_allocator); | 165 DCHECK(broker_sandboxer_allocator); |
| 166 UpdateProcessTypeToGpuBroker(); | 166 UpdateProcessTypeToGpuBroker(); |
| 167 return SandboxSeccompBPF::StartSandboxWithExternalPolicy( | 167 return SandboxSeccompBPF::StartSandboxWithExternalPolicy( |
| 168 make_scoped_ptr(broker_sandboxer_allocator())); | 168 make_scoped_ptr(broker_sandboxer_allocator()), base::ScopedFD()); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace | 171 } // namespace |
| 172 | 172 |
| 173 GpuProcessPolicy::GpuProcessPolicy() : GpuProcessPolicy(false) { | 173 GpuProcessPolicy::GpuProcessPolicy() : GpuProcessPolicy(false) { |
| 174 } | 174 } |
| 175 | 175 |
| 176 GpuProcessPolicy::GpuProcessPolicy(bool allow_mincore) | 176 GpuProcessPolicy::GpuProcessPolicy(bool allow_mincore) |
| 177 : broker_process_(NULL), allow_mincore_(allow_mincore) { | 177 : broker_process_(NULL), allow_mincore_(allow_mincore) { |
| 178 } | 178 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), | 283 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), |
| 284 read_whitelist, | 284 read_whitelist, |
| 285 write_whitelist); | 285 write_whitelist); |
| 286 // The initialization callback will perform generic initialization and then | 286 // The initialization callback will perform generic initialization and then |
| 287 // call broker_sandboxer_callback. | 287 // call broker_sandboxer_callback. |
| 288 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, | 288 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, |
| 289 broker_sandboxer_allocator))); | 289 broker_sandboxer_allocator))); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace content | 292 } // namespace content |
| OLD | NEW |