| 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/zygote/zygote_main.h" | 5 #include "content/zygote/zygote_main.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <pthread.h> | 9 #include <pthread.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 #include <sys/socket.h> | 11 #include <sys/socket.h> |
| 12 #include <sys/types.h> | 12 #include <sys/types.h> |
| 13 #include <unistd.h> | 13 #include <unistd.h> |
| 14 | 14 |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/bind.h" | 16 #include "base/bind.h" |
| 17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 19 #include "base/memory/scoped_vector.h" | 19 #include "base/memory/scoped_vector.h" |
| 20 #include "base/native_library.h" | 20 #include "base/native_library.h" |
| 21 #include "base/pickle.h" | 21 #include "base/pickle.h" |
| 22 #include "base/posix/eintr_wrapper.h" | 22 #include "base/posix/eintr_wrapper.h" |
| 23 #include "base/posix/unix_domain_socket_linux.h" | 23 #include "base/posix/unix_domain_socket_linux.h" |
| 24 #include "base/rand_util.h" | 24 #include "base/rand_util.h" |
| 25 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
| 26 #include "base/sys_info.h" | 26 #include "base/sys_info.h" |
| 27 #include "build/build_config.h" | 27 #include "build/build_config.h" |
| 28 #include "content/common/child_process_sandbox_support_impl_linux.h" | 28 #include "content/common/child_process_sandbox_support_impl_linux.h" |
| 29 #include "content/common/font_config_ipc_linux.h" | 29 #include "content/common/font_config_ipc_linux.h" |
| 30 #include "content/common/pepper_plugin_list.h" | |
| 31 #include "content/common/sandbox_linux/sandbox_linux.h" | 30 #include "content/common/sandbox_linux/sandbox_linux.h" |
| 32 #include "content/common/zygote_commands_linux.h" | 31 #include "content/common/zygote_commands_linux.h" |
| 33 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
| 34 #include "content/public/common/main_function_params.h" | 33 #include "content/public/common/main_function_params.h" |
| 35 #include "content/public/common/pepper_plugin_info.h" | |
| 36 #include "content/public/common/sandbox_linux.h" | 34 #include "content/public/common/sandbox_linux.h" |
| 37 #include "content/public/common/zygote_fork_delegate_linux.h" | 35 #include "content/public/common/zygote_fork_delegate_linux.h" |
| 38 #include "content/zygote/zygote_linux.h" | 36 #include "content/zygote/zygote_linux.h" |
| 39 #include "crypto/nss_util.h" | 37 #include "crypto/nss_util.h" |
| 40 #include "sandbox/linux/services/init_process_reaper.h" | 38 #include "sandbox/linux/services/init_process_reaper.h" |
| 41 #include "sandbox/linux/services/libc_urandom_override.h" | 39 #include "sandbox/linux/services/libc_urandom_override.h" |
| 42 #include "sandbox/linux/suid/client/setuid_sandbox_client.h" | 40 #include "sandbox/linux/suid/client/setuid_sandbox_client.h" |
| 43 #include "third_party/icu/source/i18n/unicode/timezone.h" | 41 #include "third_party/icu/source/i18n/unicode/timezone.h" |
| 44 #include "third_party/skia/include/ports/SkFontConfigInterface.h" | 42 #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
| 45 | 43 |
| 46 #if defined(OS_LINUX) | 44 #if defined(OS_LINUX) |
| 47 #include <sys/prctl.h> | 45 #include <sys/prctl.h> |
| 48 #endif | 46 #endif |
| 49 | 47 |
| 50 #if defined(USE_OPENSSL) | 48 #if defined(USE_OPENSSL) |
| 51 #include <openssl/rand.h> | 49 #include <openssl/rand.h> |
| 52 #endif | 50 #endif |
| 53 | 51 |
| 52 #if defined(ENABLE_PLUGINS) |
| 53 #include "content/common/pepper_plugin_list.h" |
| 54 #include "content/public/common/pepper_plugin_info.h" |
| 55 #endif |
| 56 |
| 54 #if defined(ENABLE_WEBRTC) | 57 #if defined(ENABLE_WEBRTC) |
| 55 #include "third_party/libjingle/overrides/init_webrtc.h" | 58 #include "third_party/libjingle/overrides/init_webrtc.h" |
| 56 #endif | 59 #endif |
| 57 | 60 |
| 58 #if defined(ADDRESS_SANITIZER) | 61 #if defined(ADDRESS_SANITIZER) |
| 59 #include <sanitizer/asan_interface.h> | 62 #include <sanitizer/asan_interface.h> |
| 60 #endif | 63 #endif |
| 61 | 64 |
| 62 namespace content { | 65 namespace content { |
| 63 | 66 |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 bool setuid_sandbox_engaged = sandbox_flags & kSandboxLinuxSUID; | 571 bool setuid_sandbox_engaged = sandbox_flags & kSandboxLinuxSUID; |
| 569 CHECK_EQ(must_enable_setuid_sandbox, setuid_sandbox_engaged); | 572 CHECK_EQ(must_enable_setuid_sandbox, setuid_sandbox_engaged); |
| 570 | 573 |
| 571 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children, | 574 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children, |
| 572 extra_fds); | 575 extra_fds); |
| 573 // This function call can return multiple times, once per fork(). | 576 // This function call can return multiple times, once per fork(). |
| 574 return zygote.ProcessRequests(); | 577 return zygote.ProcessRequests(); |
| 575 } | 578 } |
| 576 | 579 |
| 577 } // namespace content | 580 } // namespace content |
| OLD | NEW |