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> |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 } | 304 } |
305 } | 305 } |
306 #endif | 306 #endif |
307 | 307 |
308 // This function triggers the static and lazy construction of objects that need | 308 // This function triggers the static and lazy construction of objects that need |
309 // to be created before imposing the sandbox. | 309 // to be created before imposing the sandbox. |
310 static void ZygotePreSandboxInit() { | 310 static void ZygotePreSandboxInit() { |
311 base::RandUint64(); | 311 base::RandUint64(); |
312 | 312 |
313 base::SysInfo::AmountOfPhysicalMemory(); | 313 base::SysInfo::AmountOfPhysicalMemory(); |
| 314 base::SysInfo::AmountOfVirtualMemory(); |
314 base::SysInfo::MaxSharedMemorySize(); | 315 base::SysInfo::MaxSharedMemorySize(); |
315 base::SysInfo::NumberOfProcessors(); | 316 base::SysInfo::NumberOfProcessors(); |
316 | 317 |
317 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 318 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
318 // Olson timezone ID by accessing the zoneinfo files on disk. After | 319 // Olson timezone ID by accessing the zoneinfo files on disk. After |
319 // TimeZone::createDefault is called once here, the timezone ID is | 320 // TimeZone::createDefault is called once here, the timezone ID is |
320 // cached and there's no more need to access the file system. | 321 // cached and there's no more need to access the file system. |
321 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 322 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
322 | 323 |
323 #if defined(USE_NSS) | 324 #if defined(USE_NSS) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 EnterLayerOneSandbox(linux_sandbox); | 467 EnterLayerOneSandbox(linux_sandbox); |
467 | 468 |
468 int sandbox_flags = linux_sandbox->GetStatus(); | 469 int sandbox_flags = linux_sandbox->GetStatus(); |
469 | 470 |
470 Zygote zygote(sandbox_flags, forkdelegate); | 471 Zygote zygote(sandbox_flags, forkdelegate); |
471 // This function call can return multiple times, once per fork(). | 472 // This function call can return multiple times, once per fork(). |
472 return zygote.ProcessRequests(); | 473 return zygote.ProcessRequests(); |
473 } | 474 } |
474 | 475 |
475 } // namespace content | 476 } // namespace content |
OLD | NEW |