From b1a957cac5b49dd94069d0764451d8d47d35dd67 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 8 Jan 2015 11:25:50 -0800 Subject: [PATCH] Support ICU on Android This CL adds an icu_data application that vends ICU data to clients via shared memory. We use a sha1hash to validate the integrity of the data. Currently, this icu_data service is used on Android only. Desktop platforms load the ICU data table from the file system, as they did before. See the mojo-dev discussion for more background. R=jamesr@chromium.org Review URL: https://codereview.chromium.org/826093004 --- viewer/BUILD.gn | 2 +- viewer/viewer.cc | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/viewer/BUILD.gn b/viewer/BUILD.gn index ba43f33aa97..76406d7d781 100644 --- a/viewer/BUILD.gn +++ b/viewer/BUILD.gn @@ -37,7 +37,6 @@ mojo_native_application("viewer") { deps = [ ":bindings", ":sky_modules", - "//base:i18n", "//gin", "//mojo/application", "//mojo/common", @@ -45,6 +44,7 @@ mojo_native_application("viewer") { "//mojo/converters/geometry", "//mojo/converters/surfaces", "//mojo/edk/js", + "//mojo/icu", "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//mojo/public/cpp/utility", diff --git a/viewer/viewer.cc b/viewer/viewer.cc index d38a891a7b8..7db37a3a3c9 100644 --- a/viewer/viewer.cc +++ b/viewer/viewer.cc @@ -7,6 +7,7 @@ #include "base/threading/thread.h" #include "mojo/application/application_runner_chromium.h" #include "mojo/common/tracing_impl.h" +#include "mojo/icu/icu.h" #include "mojo/public/c/system/main.h" #include "mojo/public/cpp/application/application_connection.h" #include "mojo/public/cpp/application/application_delegate.h" @@ -20,10 +21,6 @@ #include "sky/viewer/document_view.h" #include "sky/viewer/platform/platform_impl.h" -#if !defined(COMPONENT_BUILD) -#include "base/i18n/icu_util.h" -#endif - namespace sky { // Load the viewer in testing mode so we can dump pixels. @@ -50,11 +47,7 @@ class Viewer : public mojo::ApplicationDelegate, platform_impl_.reset(new PlatformImpl(app)); blink::initialize(platform_impl_.get()); - // TODO(eseidel): Haven't solved ICU data loading for MojoShell.apk yet. -#if !defined(OS_ANDROID) - base::i18n::InitializeICU(); -#endif - + mojo::icu::Initialize(app); mojo::TracingImpl::Create(app); }