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 "content/browser/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
6 | 6 |
7 #include <utility> // For std::pair. | 7 #include <utility> // For std::pair. |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/content_browser_client.h" | 18 #include "content/public/browser/content_browser_client.h" |
19 #include "content/public/common/content_descriptors.h" | 19 #include "content/public/common/content_descriptors.h" |
20 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
21 #include "content/public/common/result_codes.h" | 21 #include "content/public/common/result_codes.h" |
22 | 22 |
23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
24 #include "base/file_path.h" | 24 #include "base/file_path.h" |
25 #include "content/common/sandbox_policy.h" | 25 #include "content/common/sandbox_policy.h" |
| 26 #include "content/public/common/sandbox_init.h" |
26 #elif defined(OS_MACOSX) | 27 #elif defined(OS_MACOSX) |
27 #include "content/browser/mach_broker_mac.h" | 28 #include "content/browser/mach_broker_mac.h" |
28 #elif defined(OS_ANDROID) | 29 #elif defined(OS_ANDROID) |
29 #include "base/android/jni_android.h" | 30 #include "base/android/jni_android.h" |
30 #include "content/browser/android/sandboxed_process_launcher.h" | 31 #include "content/browser/android/sandboxed_process_launcher.h" |
31 #elif defined(OS_POSIX) | 32 #elif defined(OS_POSIX) |
32 #include "base/memory/singleton.h" | 33 #include "base/memory/singleton.h" |
33 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 34 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
34 #include "content/browser/zygote_host/zygote_host_impl_linux.h" | 35 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
35 #endif | 36 #endif |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 int ipcfd, | 155 int ipcfd, |
155 #elif defined(OS_POSIX) | 156 #elif defined(OS_POSIX) |
156 bool use_zygote, | 157 bool use_zygote, |
157 const base::EnvironmentVector& env, | 158 const base::EnvironmentVector& env, |
158 int ipcfd, | 159 int ipcfd, |
159 #endif | 160 #endif |
160 CommandLine* cmd_line) { | 161 CommandLine* cmd_line) { |
161 scoped_ptr<CommandLine> cmd_line_deleter(cmd_line); | 162 scoped_ptr<CommandLine> cmd_line_deleter(cmd_line); |
162 | 163 |
163 #if defined(OS_WIN) | 164 #if defined(OS_WIN) |
164 base::ProcessHandle handle = sandbox::StartProcessWithAccess( | 165 base::ProcessHandle handle = content::StartProcessWithAccess( |
165 cmd_line, exposed_dir); | 166 cmd_line, exposed_dir); |
166 #elif defined(OS_ANDROID) | 167 #elif defined(OS_ANDROID) |
167 std::string process_type = | 168 std::string process_type = |
168 cmd_line->GetSwitchValueASCII(switches::kProcessType); | 169 cmd_line->GetSwitchValueASCII(switches::kProcessType); |
169 std::vector<content::FileDescriptorInfo> files_to_register; | 170 std::vector<content::FileDescriptorInfo> files_to_register; |
170 files_to_register.push_back( | 171 files_to_register.push_back( |
171 content::FileDescriptorInfo(kPrimaryIPCChannel, | 172 content::FileDescriptorInfo(kPrimaryIPCChannel, |
172 base::FileDescriptor(ipcfd, false))); | 173 base::FileDescriptor(ipcfd, false))); |
173 | 174 |
174 content::GetContentClient()->browser()-> | 175 content::GetContentClient()->browser()-> |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 base::Bind( | 449 base::Bind( |
449 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 450 &ChildProcessLauncher::Context::SetProcessBackgrounded, |
450 GetHandle(), background)); | 451 GetHandle(), background)); |
451 } | 452 } |
452 | 453 |
453 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 454 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
454 bool terminate_on_shutdown) { | 455 bool terminate_on_shutdown) { |
455 if (context_) | 456 if (context_) |
456 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 457 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
457 } | 458 } |
OLD | NEW |