| 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 <signal.h> | 10 #include <signal.h> |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 base::SysInfo::AmountOfPhysicalMemory(); | 331 base::SysInfo::AmountOfPhysicalMemory(); |
| 332 base::SysInfo::MaxSharedMemorySize(); | 332 base::SysInfo::MaxSharedMemorySize(); |
| 333 base::SysInfo::NumberOfProcessors(); | 333 base::SysInfo::NumberOfProcessors(); |
| 334 | 334 |
| 335 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 335 // 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 | 336 // Olson timezone ID by accessing the zoneinfo files on disk. After |
| 337 // TimeZone::createDefault is called once here, the timezone ID is | 337 // TimeZone::createDefault is called once here, the timezone ID is |
| 338 // cached and there's no more need to access the file system. | 338 // cached and there's no more need to access the file system. |
| 339 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 339 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
| 340 | 340 |
| 341 #if defined(USE_NSS) | 341 #if defined(USE_NSS_CERTS) |
| 342 // NSS libraries are loaded before sandbox is activated. This is to allow | 342 // NSS libraries are loaded before sandbox is activated. This is to allow |
| 343 // successful initialization of NSS which tries to load extra library files. | 343 // successful initialization of NSS which tries to load extra library files. |
| 344 crypto::LoadNSSLibraries(); | 344 crypto::LoadNSSLibraries(); |
| 345 #elif defined(USE_OPENSSL) | 345 #elif defined(USE_OPENSSL) |
| 346 // Read a random byte in order to cause BoringSSL to open a file descriptor | 346 // Read a random byte in order to cause BoringSSL to open a file descriptor |
| 347 // for /dev/urandom. | 347 // for /dev/urandom. |
| 348 uint8_t scratch; | 348 uint8_t scratch; |
| 349 RAND_bytes(&scratch, 1); | 349 RAND_bytes(&scratch, 1); |
| 350 #else | 350 #else |
| 351 // It's possible that another hypothetical crypto stack would not require | 351 // It's possible that another hypothetical crypto stack would not require |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 const bool namespace_sandbox_engaged = sandbox_flags & kSandboxLinuxUserNS; | 610 const bool namespace_sandbox_engaged = sandbox_flags & kSandboxLinuxUserNS; |
| 611 CHECK_EQ(using_namespace_sandbox, namespace_sandbox_engaged); | 611 CHECK_EQ(using_namespace_sandbox, namespace_sandbox_engaged); |
| 612 | 612 |
| 613 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children, | 613 Zygote zygote(sandbox_flags, fork_delegates.Pass(), extra_children, |
| 614 extra_fds); | 614 extra_fds); |
| 615 // This function call can return multiple times, once per fork(). | 615 // This function call can return multiple times, once per fork(). |
| 616 return zygote.ProcessRequests(); | 616 return zygote.ProcessRequests(); |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace content | 619 } // namespace content |
| OLD | NEW |