summaryrefslogtreecommitdiffstats
path: root/mandoline
diff options
context:
space:
mode:
authorerg <erg@chromium.org>2015-11-12 10:51:56 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-12 18:53:20 +0000
commit140735acbef15c56d9ddaadd2bc58b5e26692a48 (patch)
tree2626c072f5b40f065fd0a2e6f394220f1122d578 /mandoline
parent203833423f5a1febbdb90bdd8166a8335521e3e4 (diff)
downloadchromium_src-140735acbef15c56d9ddaadd2bc58b5e26692a48.zip
chromium_src-140735acbef15c56d9ddaadd2bc58b5e26692a48.tar.gz
chromium_src-140735acbef15c56d9ddaadd2bc58b5e26692a48.tar.bz2
mandoline: Reland "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 fixes several crashes in local runs. [[This reland disables the sandbox on the page cycler bots because they don't have a new enough kernel to be sandboxed(!). It also includes the icu data in the mojo runner unittests.]] BUG=546644 First Review URL: https://codereview.chromium.org/1425853003 TBR=jam@chromium.org,sky@chromium.org R=yzshen@chromium.org Review URL: https://codereview.chromium.org/1431133003 Cr-Commit-Position: refs/heads/master@{#359349}
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 5a94a32..60f5e32 100644
--- a/mandoline/app/desktop/launcher_process.cc
+++ b/mandoline/app/desktop/launcher_process.cc
@@ -32,8 +32,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);