summaryrefslogtreecommitdiffstats
path: root/mandoline
diff options
context:
space:
mode:
authorerg <erg@chromium.org>2015-08-10 16:05:52 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-10 23:06:30 +0000
commit7cd4b784ffd31856b32ada4efd2265a4989fd575 (patch)
treed8710eb66d728f63bc6e95d1d1576c3d60fc86c8 /mandoline
parentc6145c33172101a41953d6c9e2a6939345901949 (diff)
downloadchromium_src-7cd4b784ffd31856b32ada4efd2265a4989fd575.zip
chromium_src-7cd4b784ffd31856b32ada4efd2265a4989fd575.tar.gz
chromium_src-7cd4b784ffd31856b32ada4efd2265a4989fd575.tar.bz2
mandoline: Sandbox mojo:browser and mojo:omnibox.
BUG=492524 Review URL: https://codereview.chromium.org/1282903002 Cr-Commit-Position: refs/heads/master@{#342725}
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 7f1dd12..a11fb63 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)
@@ -38,9 +38,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 84f6f28..ece8690 100644
--- a/mandoline/services/core_services/BUILD.gn
+++ b/mandoline/services/core_services/BUILD.gn
@@ -50,6 +50,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",
]
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 71226ad..97c0005 100644
--- a/mandoline/ui/aura/BUILD.gn
+++ b/mandoline/ui/aura/BUILD.gn
@@ -50,4 +50,8 @@ source_set("aura") {
"//ui/mojo/init",
"//ui/views",
]
+
+ if (is_linux && !is_android) {
+ deps += [ "//components/font_service/public/cpp" ]
+ }
}
diff --git a/mandoline/ui/aura/DEPS b/mandoline/ui/aura/DEPS
index e7b7185..f7fe88b 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();