OLD | NEW |
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 | 9 // TODO(erg): Much of this will be the same between mojo applications. Maybe we |
10 // could centralize this code? | 10 // could centralize this code? |
11 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 11 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/sys_info.h" | 13 #include "base/sys_info.h" |
| 14 #include "third_party/icu/source/i18n/unicode/timezone.h" |
14 | 15 |
15 // TODO(erg): Much of this was coppied from zygote_main_linux.cc | 16 // TODO(erg): Much of this was coppied from zygote_main_linux.cc |
16 extern "C" { | 17 extern "C" { |
17 void __attribute__((visibility("default"))) MojoSandboxWarm() { | 18 void __attribute__((visibility("default"))) MojoSandboxWarm() { |
18 base::RandUint64(); | 19 base::RandUint64(); |
19 base::SysInfo::AmountOfPhysicalMemory(); | 20 base::SysInfo::AmountOfPhysicalMemory(); |
20 base::SysInfo::MaxSharedMemorySize(); | 21 base::SysInfo::MaxSharedMemorySize(); |
21 base::SysInfo::NumberOfProcessors(); | 22 base::SysInfo::NumberOfProcessors(); |
22 | 23 |
23 // TODO(erg): icu does timezone initialization here. | 24 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
| 25 // Olson timezone ID by accessing the zoneinfo files on disk. After |
| 26 // TimeZone::createDefault is called once here, the timezone ID is |
| 27 // cached and there's no more need to access the file system. |
| 28 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
24 | 29 |
25 // TODO(erg): Perform OpenSSL warmup; it wants access to /dev/urandom. | 30 // 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 } | 31 } |
30 } | 32 } |
31 #endif // defined(OS_LINUX) && !defined(OS_ANDROID) | 33 #endif // defined(OS_LINUX) && !defined(OS_ANDROID) |
32 | 34 |
33 MojoResult MojoMain(MojoHandle shell_handle) { | 35 MojoResult MojoMain(MojoHandle shell_handle) { |
34 mojo::ApplicationRunner runner( | 36 mojo::ApplicationRunner runner( |
35 new core_services::CoreServicesApplicationDelegate); | 37 new core_services::CoreServicesApplicationDelegate); |
36 return runner.Run(shell_handle); | 38 return runner.Run(shell_handle); |
37 } | 39 } |
OLD | NEW |