summaryrefslogtreecommitdiffstats
path: root/mandoline
diff options
context:
space:
mode:
authorerg <erg@chromium.org>2015-08-17 15:48:25 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-17 22:49:08 +0000
commita44b5ebab57a94c3ad673128b5d9da90e94a33aa (patch)
treeb38b1ee420104cf5c350716c0844fe35344a72b6 /mandoline
parentc752712ead6a6fbf2160786d29137bf3455bc091 (diff)
downloadchromium_src-a44b5ebab57a94c3ad673128b5d9da90e94a33aa.zip
chromium_src-a44b5ebab57a94c3ad673128b5d9da90e94a33aa.tar.gz
chromium_src-a44b5ebab57a94c3ad673128b5d9da90e94a33aa.tar.bz2
mandoline: Reland "Sandbox mojo:browser and mojo:omnibox."
This is a straight reland of the previous patch; as the manual usage of icu was removed in https://codereview.chromium.org/1281343003/. BUG=492524 Previous Review URL: https://codereview.chromium.org/1282903002 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/1286773002 Cr-Commit-Position: refs/heads/master@{#343765}
Diffstat (limited to 'mandoline')
-rw-r--r--mandoline/app/core_services_initialization.cc9
-rw-r--r--mandoline/services/core_services/BUILD.gn1
-rw-r--r--mandoline/services/core_services/main.cc10
-rw-r--r--mandoline/ui/aura/BUILD.gn4
-rw-r--r--mandoline/ui/aura/DEPS1
-rw-r--r--mandoline/ui/aura/aura_init.cc10
6 files changed, 27 insertions, 8 deletions
diff --git a/mandoline/app/core_services_initialization.cc b/mandoline/app/core_services_initialization.cc
index 1b3c45e..84f35b5 100644
--- a/mandoline/app/core_services_initialization.cc
+++ b/mandoline/app/core_services_initialization.cc
@@ -13,7 +13,7 @@ void InitCoreServicesForContext(mojo::runner::Context* context) {
// autogenerated from package manifests.
mojo::shell::ApplicationManager* manager = context->application_manager();
manager->RegisterApplicationPackageAlias(
- GURL("mojo:clipboard"), GURL("mojo:core_services"), "Sandboxed Core");
+ GURL("mojo:clipboard"), GURL("mojo:core_services"), "Core");
manager->RegisterApplicationPackageAlias(GURL("mojo:filesystem"),
GURL("mojo:core_services"), "Files");
#if defined(OS_LINUX) && !defined(OS_ANDROID)
@@ -28,7 +28,7 @@ void InitCoreServicesForContext(mojo::runner::Context* context) {
manager->RegisterApplicationPackageAlias(
GURL("mojo:network_service"), GURL("mojo:core_services"), "Network");
manager->RegisterApplicationPackageAlias(
- GURL("mojo:resource_provider"), GURL("mojo:core_services"), "Core");
+ GURL("mojo:resource_provider"), GURL("mojo:core_services"), "Files");
#endif
#if defined(USE_AURA)
@@ -40,9 +40,10 @@ void InitCoreServicesForContext(mojo::runner::Context* context) {
manager->RegisterApplicationPackageAlias(
GURL("mojo:surfaces_service"), GURL("mojo:core_services"), "Surfaces");
manager->RegisterApplicationPackageAlias(
- GURL("mojo:tracing"), GURL("mojo:core_services"), "Sandboxed Core");
+ GURL("mojo:tracing"), GURL("mojo:core_services"), "Core");
manager->RegisterApplicationPackageAlias(GURL("mojo:browser"),
- GURL("mojo:core_services"), "Core");
+ GURL("mojo:core_services"),
+ "Core");
}
} // namespace mandoline
diff --git a/mandoline/services/core_services/BUILD.gn b/mandoline/services/core_services/BUILD.gn
index 4678d7f..11fffe4 100644
--- a/mandoline/services/core_services/BUILD.gn
+++ b/mandoline/services/core_services/BUILD.gn
@@ -53,6 +53,7 @@ source_set("sources") {
"//mojo/common:tracing_impl",
"//mojo/message_pump",
"//mojo/services/tracing:lib",
+ "//third_party/icu",
"//third_party/mojo/src/mojo/public/cpp/bindings",
"//url",
]
diff --git a/mandoline/services/core_services/main.cc b/mandoline/services/core_services/main.cc
index 91f81e5..e9d36ba 100644
--- a/mandoline/services/core_services/main.cc
+++ b/mandoline/services/core_services/main.cc
@@ -11,6 +11,7 @@
#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" {
@@ -20,12 +21,13 @@ void __attribute__((visibility("default"))) MojoSandboxWarm() {
base::SysInfo::MaxSharedMemorySize();
base::SysInfo::NumberOfProcessors();
- // TODO(erg): icu does timezone initialization here.
+ // 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.
-
- // TODO(erg): Initialize SkFontConfigInterface; it has its own odd IPC system
- // which probably must be ported to mojo.
}
}
#endif // defined(OS_LINUX) && !defined(OS_ANDROID)
diff --git a/mandoline/ui/aura/BUILD.gn b/mandoline/ui/aura/BUILD.gn
index 9f1fb89..371941e 100644
--- a/mandoline/ui/aura/BUILD.gn
+++ b/mandoline/ui/aura/BUILD.gn
@@ -53,4 +53,8 @@ source_set("aura") {
"//ui/views",
"//ui/wm",
]
+
+ if (is_linux && !is_android) {
+ deps += [ "//components/font_service/public/cpp" ]
+ }
}
diff --git a/mandoline/ui/aura/DEPS b/mandoline/ui/aura/DEPS
index bf6ea99..5348311 100644
--- a/mandoline/ui/aura/DEPS
+++ b/mandoline/ui/aura/DEPS
@@ -1,6 +1,7 @@
include_rules = [
"+cc",
"-cc/blink",
+ "+components/font_service/public",
"+components/gpu",
"+components/resource_provider",
"+components/view_manager",
diff --git a/mandoline/ui/aura/aura_init.cc b/mandoline/ui/aura/aura_init.cc
index 9873aa0..86c65d7 100644
--- a/mandoline/ui/aura/aura_init.cc
+++ b/mandoline/ui/aura/aura_init.cc
@@ -15,6 +15,10 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#if defined(OS_LINUX) && !defined(OS_ANDROID)
+#include "components/font_service/public/cpp/font_loader.h"
+#endif
+
namespace mandoline {
namespace {
@@ -60,6 +64,12 @@ void AuraInit::InitializeResources(mojo::Shell* shell) {
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
resource_loader.ReleaseFile(kResourceUIPak),
ui::SCALE_FACTOR_100P);
+
+ // Initialize the skia font code to go ask fontconfig underneath.
+#if defined(OS_LINUX) && !defined(OS_ANDROID)
+ SkFontConfigInterface::SetGlobal(new font_service::FontLoader(shell));
+#endif
+
// There is a bunch of static state in gfx::Font, by running this now,
// before any other apps load, we ensure all the state is set up.
gfx::Font();