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> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <pthread.h> | 10 #include <pthread.h> |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <sys/socket.h> | 12 #include <sys/socket.h> |
13 #include <sys/stat.h> | 13 #include <sys/stat.h> |
14 #include <sys/types.h> | 14 #include <sys/types.h> |
15 #include <sys/wait.h> | 15 #include <sys/wait.h> |
16 #include <unistd.h> | 16 #include <unistd.h> |
17 | 17 |
18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
19 #include "base/bind.h" | 19 #include "base/bind.h" |
20 #include "base/callback.h" | 20 #include "base/callback.h" |
21 #include "base/command_line.h" | 21 #include "base/command_line.h" |
22 #include "base/compiler_specific.h" | 22 #include "base/compiler_specific.h" |
| 23 #include "base/cpu.h" |
23 #include "base/linux_util.h" | 24 #include "base/linux_util.h" |
24 #include "base/native_library.h" | 25 #include "base/native_library.h" |
25 #include "base/pickle.h" | 26 #include "base/pickle.h" |
26 #include "base/posix/unix_domain_socket_linux.h" | 27 #include "base/posix/unix_domain_socket_linux.h" |
27 #include "base/rand_util.h" | 28 #include "base/rand_util.h" |
28 #include "base/sys_info.h" | 29 #include "base/sys_info.h" |
29 #include "build/build_config.h" | 30 #include "build/build_config.h" |
30 #include "content/common/child_process_sandbox_support_impl_linux.h" | 31 #include "content/common/child_process_sandbox_support_impl_linux.h" |
31 #include "content/common/font_config_ipc_linux.h" | 32 #include "content/common/font_config_ipc_linux.h" |
32 #include "content/common/pepper_plugin_list.h" | 33 #include "content/common/pepper_plugin_list.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 #endif | 292 #endif |
292 | 293 |
293 // This function triggers the static and lazy construction of objects that need | 294 // This function triggers the static and lazy construction of objects that need |
294 // to be created before imposing the sandbox. | 295 // to be created before imposing the sandbox. |
295 static void ZygotePreSandboxInit() { | 296 static void ZygotePreSandboxInit() { |
296 base::RandUint64(); | 297 base::RandUint64(); |
297 | 298 |
298 base::SysInfo::AmountOfPhysicalMemory(); | 299 base::SysInfo::AmountOfPhysicalMemory(); |
299 base::SysInfo::MaxSharedMemorySize(); | 300 base::SysInfo::MaxSharedMemorySize(); |
300 base::SysInfo::NumberOfProcessors(); | 301 base::SysInfo::NumberOfProcessors(); |
| 302 #if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_AURA) |
| 303 base::CPU::CpuBrandInfo(); |
| 304 #endif |
301 | 305 |
302 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 306 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
303 // Olson timezone ID by accessing the zoneinfo files on disk. After | 307 // Olson timezone ID by accessing the zoneinfo files on disk. After |
304 // TimeZone::createDefault is called once here, the timezone ID is | 308 // TimeZone::createDefault is called once here, the timezone ID is |
305 // cached and there's no more need to access the file system. | 309 // cached and there's no more need to access the file system. |
306 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 310 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
307 | 311 |
308 #if defined(USE_NSS) | 312 #if defined(USE_NSS) |
309 // NSS libraries are loaded before sandbox is activated. This is to allow | 313 // NSS libraries are loaded before sandbox is activated. This is to allow |
310 // successful initialization of NSS which tries to load extra library files. | 314 // successful initialization of NSS which tries to load extra library files. |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 EnterLayerOneSandbox(linux_sandbox); | 455 EnterLayerOneSandbox(linux_sandbox); |
452 | 456 |
453 int sandbox_flags = linux_sandbox->GetStatus(); | 457 int sandbox_flags = linux_sandbox->GetStatus(); |
454 | 458 |
455 Zygote zygote(sandbox_flags, forkdelegate); | 459 Zygote zygote(sandbox_flags, forkdelegate); |
456 // This function call can return multiple times, once per fork(). | 460 // This function call can return multiple times, once per fork(). |
457 return zygote.ProcessRequests(); | 461 return zygote.ProcessRequests(); |
458 } | 462 } |
459 | 463 |
460 } // namespace content | 464 } // namespace content |
OLD | NEW |