summaryrefslogtreecommitdiffstats
path: root/mandoline
diff options
context:
space:
mode:
authorerg <erg@chromium.org>2015-08-06 20:06:44 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-07 03:07:26 +0000
commit4196dfefc131b0a77a3e02e917b852dba8faf445 (patch)
treea291dd1a326fd48483007b94cc1440cbebb3b02f /mandoline
parent862a9d9c5b475b05b6bb1741f782b8459967591e (diff)
downloadchromium_src-4196dfefc131b0a77a3e02e917b852dba8faf445.zip
chromium_src-4196dfefc131b0a77a3e02e917b852dba8faf445.tar.gz
chromium_src-4196dfefc131b0a77a3e02e917b852dba8faf445.tar.bz2
Sandbox html_viewer on Linux.
This creates a font_service which does the same role as font_config_ipc_linux.cc does in content/. This lets us sandbox the html_viewer, while still being able to communicate with fontconfig. Also prewarms the ICU timezone data, along with doing all the prewarming that's done in the core_services sandbox. BUG=492524 NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1274743004 Cr-Commit-Position: refs/heads/master@{#342281}
Diffstat (limited to 'mandoline')
-rw-r--r--mandoline/app/core_services_initialization.cc4
-rw-r--r--mandoline/services/core_services/BUILD.gn4
-rw-r--r--mandoline/services/core_services/DEPS1
-rw-r--r--mandoline/services/core_services/core_services_application_delegate.cc8
4 files changed, 17 insertions, 0 deletions
diff --git a/mandoline/app/core_services_initialization.cc b/mandoline/app/core_services_initialization.cc
index 304fe1e..7f1dd12 100644
--- a/mandoline/app/core_services_initialization.cc
+++ b/mandoline/app/core_services_initialization.cc
@@ -16,6 +16,10 @@ void InitCoreServicesForContext(mojo::runner::Context* context) {
GURL("mojo:clipboard"), GURL("mojo:core_services"), "Sandboxed Core");
manager->RegisterApplicationPackageAlias(GURL("mojo:filesystem"),
GURL("mojo:core_services"), "Files");
+#if defined(OS_LINUX) && !defined(OS_ANDROID)
+ manager->RegisterApplicationPackageAlias(GURL("mojo:font_service"),
+ GURL("mojo:core_services"), "Files");
+#endif
#if !defined(OS_ANDROID)
// On Android, these are Java apps which are loaded in the shell process.
manager->RegisterApplicationPackageAlias(GURL("mojo:view_manager"),
diff --git a/mandoline/services/core_services/BUILD.gn b/mandoline/services/core_services/BUILD.gn
index 2a34b61..cf640e6 100644
--- a/mandoline/services/core_services/BUILD.gn
+++ b/mandoline/services/core_services/BUILD.gn
@@ -60,6 +60,10 @@ source_set("sources") {
]
}
+ if (is_linux && !is_android) {
+ deps += [ "//components/font_service:lib" ]
+ }
+
if (use_aura) {
deps += [
"//components/view_manager/public/cpp",
diff --git a/mandoline/services/core_services/DEPS b/mandoline/services/core_services/DEPS
index 90dcddc..ca0908aa 100644
--- a/mandoline/services/core_services/DEPS
+++ b/mandoline/services/core_services/DEPS
@@ -1,6 +1,7 @@
include_rules = [
"+components/clipboard",
"+components/filesystem",
+ "+components/font_service",
"+components/resource_provider",
"+components/view_manager",
"+mojo/application",
diff --git a/mandoline/services/core_services/core_services_application_delegate.cc b/mandoline/services/core_services/core_services_application_delegate.cc
index 7805164..d3ef946 100644
--- a/mandoline/services/core_services/core_services_application_delegate.cc
+++ b/mandoline/services/core_services/core_services_application_delegate.cc
@@ -28,6 +28,10 @@
#include "mojo/services/network/network_service_delegate.h"
#endif
+#if defined(OS_LINUX) && !defined(OS_ANDROID)
+#include "components/font_service/font_service_app.h"
+#endif
+
namespace core_services {
// A helper class for hosting a mojo::ApplicationImpl on its own thread.
@@ -130,6 +134,10 @@ void CoreServicesApplicationDelegate::StartApplication(
delegate.reset(new clipboard::ClipboardApplicationDelegate);
} else if (url == "mojo://filesystem/") {
delegate.reset(new filesystem::FileSystemApp);
+#if defined(OS_LINUX) && !defined(OS_ANDROID)
+ } else if (url == "mojo://font_service/") {
+ delegate.reset(new font_service::FontServiceApp);
+#endif
} else if (url == "mojo://surfaces_service/") {
delegate.reset(new surfaces::SurfacesServiceApplication);
} else if (url == "mojo://tracing/") {