summaryrefslogtreecommitdiffstats
path: root/mojo/runner/child_process.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mojo/runner/child_process.cc')
-rw-r--r--mojo/runner/child_process.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/mojo/runner/child_process.cc b/mojo/runner/child_process.cc
index ebce4db..33ac3cd 100644
--- a/mojo/runner/child_process.cc
+++ b/mojo/runner/child_process.cc
@@ -9,7 +9,6 @@
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
-#include "base/i18n/icu_util.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
@@ -25,7 +24,6 @@
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/runner/child/child_controller.mojom.h"
-#include "mojo/runner/init.h"
#include "mojo/runner/native_application_support.h"
#include "mojo/runner/switches.h"
#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
@@ -294,17 +292,22 @@ int ChildProcessMain() {
app_library = mojo::runner::LoadNativeApplication(
command_line.GetSwitchValuePath(switches::kChildProcess));
- base::i18n::InitializeICU();
- CallLibraryEarlyInitialization(app_library);
-
#if defined(OS_LINUX) && !defined(OS_ANDROID)
if (command_line.HasSwitch(switches::kEnableSandbox)) {
- // Warm parts of base in the copy of base in the mojo runner.
+ // Warm parts of base.
base::RandUint64();
base::SysInfo::AmountOfPhysicalMemory();
base::SysInfo::MaxSharedMemorySize();
base::SysInfo::NumberOfProcessors();
+ // Do whatever warming that the mojo application wants.
+ typedef void (*SandboxWarmFunction)();
+ SandboxWarmFunction sandbox_warm = reinterpret_cast<SandboxWarmFunction>(
+ base::GetFunctionPointerFromNativeLibrary(app_library,
+ "MojoSandboxWarm"));
+ if (sandbox_warm)
+ sandbox_warm();
+
// TODO(erg,jln): Allowing access to all of /dev/shm/ makes it easy to
// spy on other shared memory using processes. This is a temporary hack
// so that we have some sandbox until we have proper shared memory