| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "content/browser/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
| 24 #include "content/public/common/result_codes.h" | 24 #include "content/public/common/result_codes.h" |
| 25 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 25 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
| 26 | 26 |
| 27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 28 #include "base/files/file_path.h" | 28 #include "base/files/file_path.h" |
| 29 #include "content/common/sandbox_win.h" | 29 #include "content/common/sandbox_win.h" |
| 30 #include "content/public/common/sandbox_init.h" | 30 #include "content/public/common/sandbox_init.h" |
| 31 #elif defined(OS_MACOSX) | 31 #elif defined(OS_MACOSX) |
| 32 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 32 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
| 33 #include "content/browser/browser_io_surface_manager_mac.h" | |
| 34 #include "content/browser/mach_broker_mac.h" | 33 #include "content/browser/mach_broker_mac.h" |
| 35 #include "sandbox/mac/bootstrap_sandbox.h" | 34 #include "sandbox/mac/bootstrap_sandbox.h" |
| 36 #include "sandbox/mac/pre_exec_delegate.h" | 35 #include "sandbox/mac/pre_exec_delegate.h" |
| 37 #elif defined(OS_ANDROID) | 36 #elif defined(OS_ANDROID) |
| 38 #include "base/android/jni_android.h" | 37 #include "base/android/jni_android.h" |
| 39 #include "content/browser/android/child_process_launcher_android.h" | 38 #include "content/browser/android/child_process_launcher_android.h" |
| 40 #elif defined(OS_POSIX) | 39 #elif defined(OS_POSIX) |
| 41 #include "base/memory/singleton.h" | 40 #include "base/memory/singleton.h" |
| 42 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 41 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 43 #include "content/browser/zygote_host/zygote_host_impl_linux.h" | 42 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // inserted below. This ensures that while the child process may send its | 235 // inserted below. This ensures that while the child process may send its |
| 237 // port to the parent prior to the parent leaving LaunchProcess, the | 236 // port to the parent prior to the parent leaving LaunchProcess, the |
| 238 // order in which the record in MachBroker is updated is correct. | 237 // order in which the record in MachBroker is updated is correct. |
| 239 MachBroker* broker = MachBroker::GetInstance(); | 238 MachBroker* broker = MachBroker::GetInstance(); |
| 240 broker->GetLock().Acquire(); | 239 broker->GetLock().Acquire(); |
| 241 | 240 |
| 242 // Make sure the MachBroker is running, and inform it to expect a | 241 // Make sure the MachBroker is running, and inform it to expect a |
| 243 // check-in from the new process. | 242 // check-in from the new process. |
| 244 broker->EnsureRunning(); | 243 broker->EnsureRunning(); |
| 245 | 244 |
| 246 // Make sure the IOSurfaceManager service is running. | |
| 247 BrowserIOSurfaceManager::GetInstance()->EnsureRunning(); | |
| 248 | |
| 249 const SandboxType sandbox_type = delegate->GetSandboxType(); | 245 const SandboxType sandbox_type = delegate->GetSandboxType(); |
| 250 scoped_ptr<sandbox::PreExecDelegate> pre_exec_delegate; | 246 scoped_ptr<sandbox::PreExecDelegate> pre_exec_delegate; |
| 251 if (BootstrapSandboxManager::ShouldEnable()) { | 247 if (BootstrapSandboxManager::ShouldEnable()) { |
| 252 BootstrapSandboxManager* sandbox_manager = | 248 BootstrapSandboxManager* sandbox_manager = |
| 253 BootstrapSandboxManager::GetInstance(); | 249 BootstrapSandboxManager::GetInstance(); |
| 254 if (sandbox_manager->EnabledForSandbox(sandbox_type)) { | 250 if (sandbox_manager->EnabledForSandbox(sandbox_type)) { |
| 255 pre_exec_delegate = | 251 pre_exec_delegate = |
| 256 sandbox_manager->sandbox()->NewClient(sandbox_type).Pass(); | 252 sandbox_manager->sandbox()->NewClient(sandbox_type).Pass(); |
| 257 } | 253 } |
| 258 } | 254 } |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 } | 521 } |
| 526 | 522 |
| 527 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 523 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
| 528 Client* client) { | 524 Client* client) { |
| 529 Client* ret = client_; | 525 Client* ret = client_; |
| 530 client_ = client; | 526 client_ = client; |
| 531 return ret; | 527 return ret; |
| 532 } | 528 } |
| 533 | 529 |
| 534 } // namespace content | 530 } // namespace content |
| OLD | NEW |