summaryrefslogtreecommitdiffstats
path: root/mandoline
diff options
context:
space:
mode:
authorerg <erg@chromium.org>2015-11-10 13:22:56 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-10 21:24:08 +0000
commite5735ff0a8ddb61672d964a44ebc8a8ebe2b6242 (patch)
treee0a5ae54ff6e4ad8f9c409978c48ace5ca7a5540 /mandoline
parent06c6305d0c309423a7e415eef22da864fd234c56 (diff)
downloadchromium_src-e5735ff0a8ddb61672d964a44ebc8a8ebe2b6242.zip
chromium_src-e5735ff0a8ddb61672d964a44ebc8a8ebe2b6242.tar.gz
chromium_src-e5735ff0a8ddb61672d964a44ebc8a8ebe2b6242.tar.bz2
mandoline: Fix ICU initialization.
We need to complete the initialization of ICU before we raise the sandbox. That means we can't pass a file descriptor to the ICU data file across mojo pipes. Due to how Android handles resources files, we also can't pass a file descriptor around inside the same process. So pass a raw pointer to a memory mapped file during the sandbox warm-up phase, and make a new option to initialize ICU from this raw pointer. But that just uncovers a bigger issue: we don't always call what was the sandbox warming code. If it's general initialization that needs to be called before we run MojoMain(), we need to include initialization code in most all main.cc implementations. This bakes a base initialize call into the mojo application library. This fixes a crash in the page cycler set, which happens when a page tries to do date operations, which fail because of missing locale data. This should let us raise the sandbox on the page cycler. BUG=546644 Review URL: https://codereview.chromium.org/1425853003 Cr-Commit-Position: refs/heads/master@{#358904}
Diffstat (limited to 'mandoline')
-rw-r--r--mandoline/app/desktop/launcher_process.cc2
-rw-r--r--mandoline/services/core_services/BUILD.gn5
-rw-r--r--mandoline/services/core_services/main.cc26
3 files changed, 0 insertions, 33 deletions
diff --git a/mandoline/app/desktop/launcher_process.cc b/mandoline/app/desktop/launcher_process.cc
index 6cec880..938534a 100644
--- a/mandoline/app/desktop/launcher_process.cc
+++ b/mandoline/app/desktop/launcher_process.cc
@@ -33,8 +33,6 @@ int LauncherProcessMain(int argc, char** argv) {
if (!command_line->HasSwitch(switches::kMojoSingleProcess))
command_line->AppendSwitch(switches::kEnableMultiprocess);
command_line->AppendSwitch("use-new-edk");
- // http://crbug.com/546644
- command_line->AppendSwitch(switches::kMojoNoSandbox);
bool trace_startup = command_line->HasSwitch(switches::kTraceStartup);
if (trace_startup) {
diff --git a/mandoline/services/core_services/BUILD.gn b/mandoline/services/core_services/BUILD.gn
index f3b6ed7..8e093f8 100644
--- a/mandoline/services/core_services/BUILD.gn
+++ b/mandoline/services/core_services/BUILD.gn
@@ -27,11 +27,6 @@ mojo_native_application("core_services") {
}
deps += [ ":copy_files" ]
}
-
- if (!is_android) {
- deps += [ "//third_party/icu:icudata" ]
- resources = [ "$root_out_dir/icudtl.dat" ]
- }
}
source_set("sources") {
diff --git a/mandoline/services/core_services/main.cc b/mandoline/services/core_services/main.cc
index e9d36ba..ef8c847 100644
--- a/mandoline/services/core_services/main.cc
+++ b/mandoline/services/core_services/main.cc
@@ -6,32 +6,6 @@
#include "mojo/application/public/cpp/application_runner.h"
#include "third_party/mojo/src/mojo/public/c/system/main.h"
-// TODO(erg): Much of this will be the same between mojo applications. Maybe we
-// could centralize this code?
-#if defined(OS_LINUX) && !defined(OS_ANDROID)
-#include "base/rand_util.h"
-#include "base/sys_info.h"
-#include "third_party/icu/source/i18n/unicode/timezone.h"
-
-// TODO(erg): Much of this was coppied from zygote_main_linux.cc
-extern "C" {
-void __attribute__((visibility("default"))) MojoSandboxWarm() {
- base::RandUint64();
- base::SysInfo::AmountOfPhysicalMemory();
- base::SysInfo::MaxSharedMemorySize();
- base::SysInfo::NumberOfProcessors();
-
- // ICU DateFormat class (used in base/time_format.cc) needs to get the
- // Olson timezone ID by accessing the zoneinfo files on disk. After
- // TimeZone::createDefault is called once here, the timezone ID is
- // cached and there's no more need to access the file system.
- scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault());
-
- // TODO(erg): Perform OpenSSL warmup; it wants access to /dev/urandom.
-}
-}
-#endif // defined(OS_LINUX) && !defined(OS_ANDROID)
-
MojoResult MojoMain(MojoHandle shell_handle) {
mojo::ApplicationRunner runner(
new core_services::CoreServicesApplicationDelegate);