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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 } | 268 } |
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(); | |
278 base::SysInfo::MaxSharedMemorySize(); | 277 base::SysInfo::MaxSharedMemorySize(); |
279 | 278 |
280 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 279 // 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 | 280 // Olson timezone ID by accessing the zoneinfo files on disk. After |
282 // TimeZone::createDefault is called once here, the timezone ID is | 281 // TimeZone::createDefault is called once here, the timezone ID is |
283 // cached and there's no more need to access the file system. | 282 // cached and there's no more need to access the file system. |
284 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 283 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
285 | 284 |
286 #if defined(USE_NSS) | 285 #if defined(USE_NSS) |
287 // NSS libraries are loaded before sandbox is activated. This is to allow | 286 // NSS libraries are loaded before sandbox is activated. This is to allow |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 } | 496 } |
498 | 497 |
499 int sandbox_flags = linux_sandbox->GetStatus(); | 498 int sandbox_flags = linux_sandbox->GetStatus(); |
500 | 499 |
501 Zygote zygote(sandbox_flags, forkdelegate); | 500 Zygote zygote(sandbox_flags, forkdelegate); |
502 // This function call can return multiple times, once per fork(). | 501 // This function call can return multiple times, once per fork(). |
503 return zygote.ProcessRequests(); | 502 return zygote.ProcessRequests(); |
504 } | 503 } |
505 | 504 |
506 } // namespace content | 505 } // namespace content |
OLD | NEW |