Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: content/zygote/zygote_main_linux.cc

Issue 55913004: Reland "Enable SysInfo::AmountOfPhysicalMemory to be called from within the Linux Sandbox" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Seperate MaxSharedMemorySize and AmountOfPhysicalMemory initialization. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/sys_info_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/sys_info_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698