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 <errno.h> | |
9 #include <fcntl.h> | |
10 #include <pthread.h> | 8 #include <pthread.h> |
11 #include <stdio.h> | 9 #include <string.h> |
12 #include <sys/socket.h> | |
13 #include <sys/stat.h> | |
14 #include <sys/types.h> | 10 #include <sys/types.h> |
15 #include <sys/wait.h> | |
16 #include <unistd.h> | 11 #include <unistd.h> |
17 | 12 |
18 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
19 #include "base/bind.h" | 14 #include "base/bind.h" |
20 #include "base/callback.h" | |
21 #include "base/command_line.h" | 15 #include "base/command_line.h" |
22 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
23 #include "base/linux_util.h" | |
24 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
25 #include "base/native_library.h" | 18 #include "base/native_library.h" |
26 #include "base/pickle.h" | 19 #include "base/pickle.h" |
27 #include "base/posix/eintr_wrapper.h" | |
28 #include "base/posix/unix_domain_socket_linux.h" | 20 #include "base/posix/unix_domain_socket_linux.h" |
29 #include "base/rand_util.h" | 21 #include "base/rand_util.h" |
30 #include "base/sys_info.h" | 22 #include "base/sys_info.h" |
31 #include "build/build_config.h" | 23 #include "build/build_config.h" |
32 #include "content/common/child_process_sandbox_support_impl_linux.h" | 24 #include "content/common/child_process_sandbox_support_impl_linux.h" |
33 #include "content/common/font_config_ipc_linux.h" | 25 #include "content/common/font_config_ipc_linux.h" |
34 #include "content/common/pepper_plugin_list.h" | 26 #include "content/common/pepper_plugin_list.h" |
35 #include "content/common/sandbox_linux/sandbox_linux.h" | 27 #include "content/common/sandbox_linux/sandbox_linux.h" |
36 #include "content/common/zygote_commands_linux.h" | 28 #include "content/common/zygote_commands_linux.h" |
37 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
38 #include "content/public/common/main_function_params.h" | 30 #include "content/public/common/main_function_params.h" |
39 #include "content/public/common/pepper_plugin_info.h" | 31 #include "content/public/common/pepper_plugin_info.h" |
40 #include "content/public/common/sandbox_linux.h" | 32 #include "content/public/common/sandbox_linux.h" |
41 #include "content/public/common/zygote_fork_delegate_linux.h" | 33 #include "content/public/common/zygote_fork_delegate_linux.h" |
42 #include "content/zygote/zygote_linux.h" | 34 #include "content/zygote/zygote_linux.h" |
43 #include "crypto/nss_util.h" | 35 #include "crypto/nss_util.h" |
44 #include "sandbox/linux/services/init_process_reaper.h" | 36 #include "sandbox/linux/services/init_process_reaper.h" |
45 #include "sandbox/linux/services/libc_urandom_override.h" | 37 #include "sandbox/linux/services/libc_urandom_override.h" |
46 #include "sandbox/linux/suid/client/setuid_sandbox_client.h" | 38 #include "sandbox/linux/suid/client/setuid_sandbox_client.h" |
47 #include "third_party/icu/source/i18n/unicode/timezone.h" | 39 #include "third_party/icu/source/i18n/unicode/timezone.h" |
48 #include "third_party/skia/include/ports/SkFontConfigInterface.h" | 40 #include "third_party/skia/include/ports/SkFontConfigInterface.h" |
49 | 41 |
50 #if defined(OS_LINUX) | 42 #if defined(OS_LINUX) |
51 #include <sys/epoll.h> | |
52 #include <sys/prctl.h> | 43 #include <sys/prctl.h> |
53 #include <sys/signal.h> | |
54 #else | |
55 #include <signal.h> | |
56 #endif | 44 #endif |
57 | 45 |
58 #if defined(ENABLE_WEBRTC) | 46 #if defined(ENABLE_WEBRTC) |
59 #include "third_party/libjingle/overrides/init_webrtc.h" | 47 #include "third_party/libjingle/overrides/init_webrtc.h" |
60 #endif | 48 #endif |
61 | 49 |
62 namespace content { | 50 namespace content { |
63 | 51 |
64 // See http://code.google.com/p/chromium/wiki/LinuxZygote | 52 // See http://code.google.com/p/chromium/wiki/LinuxZygote |
65 | 53 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 int sandbox_flags = linux_sandbox->GetStatus(); | 454 int sandbox_flags = linux_sandbox->GetStatus(); |
467 bool setuid_sandbox_engaged = sandbox_flags & kSandboxLinuxSUID; | 455 bool setuid_sandbox_engaged = sandbox_flags & kSandboxLinuxSUID; |
468 CHECK_EQ(must_enable_setuid_sandbox, setuid_sandbox_engaged); | 456 CHECK_EQ(must_enable_setuid_sandbox, setuid_sandbox_engaged); |
469 | 457 |
470 Zygote zygote(sandbox_flags, fork_delegates.Pass()); | 458 Zygote zygote(sandbox_flags, fork_delegates.Pass()); |
471 // This function call can return multiple times, once per fork(). | 459 // This function call can return multiple times, once per fork(). |
472 return zygote.ProcessRequests(); | 460 return zygote.ProcessRequests(); |
473 } | 461 } |
474 | 462 |
475 } // namespace content | 463 } // namespace content |
OLD | NEW |