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

Side by Side Diff: mandoline/services/core_services/main.cc

Issue 1264463005: mandoline sandbox: prewarm libraries before we raise the sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: And Android, too! Created 5 years, 4 months 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mandoline/services/core_services/core_services_application_delegate.h" 5 #include "mandoline/services/core_services/core_services_application_delegate.h"
6 #include "mojo/application/public/cpp/application_runner.h" 6 #include "mojo/application/public/cpp/application_runner.h"
7 #include "third_party/mojo/src/mojo/public/c/system/main.h" 7 #include "third_party/mojo/src/mojo/public/c/system/main.h"
8 8
9 // TODO(erg): Much of this will be the same between mojo applications. Maybe we
10 // could centralize this code?
11 #if defined(OS_LINUX) && !defined(OS_ANDROID)
12 #include "base/rand_util.h"
13 #include "base/sys_info.h"
14
15 // TODO(erg): Much of this was coppied from zygote_main_linux.cc
16 extern "C" {
17 void __attribute__((visibility("default"))) MojoSandboxWarm() {
18 base::RandUint64();
jln (very slow on Chromium) 2015/07/29 20:28:04 Do we still want to do that individually even thou
Elliot Glaysher 2015/07/29 21:08:32 We don't do it globally. We do it in the copy of b
19 base::SysInfo::AmountOfPhysicalMemory();
20 base::SysInfo::MaxSharedMemorySize();
21 base::SysInfo::NumberOfProcessors();
22
23 // TODO(erg): icu does timezone initialization here.
24
25 // TODO(erg): Perform OpenSSL warmup; it wants access to /dev/urandom.
26
27 // TODO(erg): Initialize SkFontConfigInterface; it has its own odd IPC system
28 // which probably must be ported to mojo.
29 }
30 }
31 #endif // defined(OS_LINUX) && !defined(OS_ANDROID)
32
9 MojoResult MojoMain(MojoHandle shell_handle) { 33 MojoResult MojoMain(MojoHandle shell_handle) {
10 mojo::ApplicationRunner runner( 34 mojo::ApplicationRunner runner(
11 new core_services::CoreServicesApplicationDelegate); 35 new core_services::CoreServicesApplicationDelegate);
12 return runner.Run(shell_handle); 36 return runner.Run(shell_handle);
13 } 37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698