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