| 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 <openssl/crypto.h> | 9 #include <openssl/crypto.h> |
| 10 #include <openssl/rand.h> | 10 #include <openssl/rand.h> |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 #endif | 324 #endif |
| 325 | 325 |
| 326 // This function triggers the static and lazy construction of objects that need | 326 // This function triggers the static and lazy construction of objects that need |
| 327 // to be created before imposing the sandbox. | 327 // to be created before imposing the sandbox. |
| 328 static void ZygotePreSandboxInit() { | 328 static void ZygotePreSandboxInit() { |
| 329 base::RandUint64(); | 329 base::RandUint64(); |
| 330 | 330 |
| 331 base::SysInfo::AmountOfPhysicalMemory(); | 331 base::SysInfo::AmountOfPhysicalMemory(); |
| 332 base::SysInfo::MaxSharedMemorySize(); | |
| 333 base::SysInfo::NumberOfProcessors(); | 332 base::SysInfo::NumberOfProcessors(); |
| 334 | 333 |
| 335 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 334 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
| 336 // Olson timezone ID by accessing the zoneinfo files on disk. After | 335 // Olson timezone ID by accessing the zoneinfo files on disk. After |
| 337 // TimeZone::createDefault is called once here, the timezone ID is | 336 // TimeZone::createDefault is called once here, the timezone ID is |
| 338 // cached and there's no more need to access the file system. | 337 // cached and there's no more need to access the file system. |
| 339 std::unique_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 338 std::unique_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
| 340 | 339 |
| 341 #if defined(ARCH_CPU_ARM_FAMILY) | 340 #if defined(ARCH_CPU_ARM_FAMILY) |
| 342 // On ARM, BoringSSL requires access to /proc/cpuinfo to determine processor | 341 // On ARM, BoringSSL requires access to /proc/cpuinfo to determine processor |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 const bool namespace_sandbox_engaged = sandbox_flags & kSandboxLinuxUserNS; | 643 const bool namespace_sandbox_engaged = sandbox_flags & kSandboxLinuxUserNS; |
| 645 CHECK_EQ(using_namespace_sandbox, namespace_sandbox_engaged); | 644 CHECK_EQ(using_namespace_sandbox, namespace_sandbox_engaged); |
| 646 | 645 |
| 647 Zygote zygote(sandbox_flags, std::move(fork_delegates), extra_children, | 646 Zygote zygote(sandbox_flags, std::move(fork_delegates), extra_children, |
| 648 extra_fds); | 647 extra_fds); |
| 649 // This function call can return multiple times, once per fork(). | 648 // This function call can return multiple times, once per fork(). |
| 650 return zygote.ProcessRequests(); | 649 return zygote.ProcessRequests(); |
| 651 } | 650 } |
| 652 | 651 |
| 653 } // namespace content | 652 } // namespace content |
| OLD | NEW |