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 <stdio.h> | 10 #include <stdio.h> |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 #endif | 270 #endif |
271 | 271 |
272 // This function triggers the static and lazy construction of objects that need | 272 // This function triggers the static and lazy construction of objects that need |
273 // to be created before imposing the sandbox. | 273 // to be created before imposing the sandbox. |
274 static void PreSandboxInit() { | 274 static void PreSandboxInit() { |
275 base::RandUint64(); | 275 base::RandUint64(); |
276 | 276 |
277 base::SysInfo::AmountOfPhysicalMemory(); | 277 base::SysInfo::AmountOfPhysicalMemory(); |
278 base::SysInfo::MaxSharedMemorySize(); | 278 base::SysInfo::MaxSharedMemorySize(); |
| 279 base::SysInfo::NumberOfProcessors(); |
279 | 280 |
280 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 281 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
281 // Olson timezone ID by accessing the zoneinfo files on disk. After | 282 // Olson timezone ID by accessing the zoneinfo files on disk. After |
282 // TimeZone::createDefault is called once here, the timezone ID is | 283 // TimeZone::createDefault is called once here, the timezone ID is |
283 // cached and there's no more need to access the file system. | 284 // cached and there's no more need to access the file system. |
284 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 285 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
285 | 286 |
286 #if defined(USE_NSS) | 287 #if defined(USE_NSS) |
287 // NSS libraries are loaded before sandbox is activated. This is to allow | 288 // NSS libraries are loaded before sandbox is activated. This is to allow |
288 // successful initialization of NSS which tries to load extra library files. | 289 // successful initialization of NSS which tries to load extra library files. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 } | 498 } |
498 | 499 |
499 int sandbox_flags = linux_sandbox->GetStatus(); | 500 int sandbox_flags = linux_sandbox->GetStatus(); |
500 | 501 |
501 Zygote zygote(sandbox_flags, forkdelegate); | 502 Zygote zygote(sandbox_flags, forkdelegate); |
502 // This function call can return multiple times, once per fork(). | 503 // This function call can return multiple times, once per fork(). |
503 return zygote.ProcessRequests(); | 504 return zygote.ProcessRequests(); |
504 } | 505 } |
505 | 506 |
506 } // namespace content | 507 } // namespace content |
OLD | NEW |