Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3777)

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 317833006: [ICU] Avoid reading ICU data files in render process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/app/chrome_main_delegate.cc
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index 168b32e9883ab402090cd3b268de83123403f838..a97a3c328e11918f680df11ae05ed706bd835d63 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -84,6 +84,7 @@
#endif
#if defined(OS_ANDROID)
+#include "base/i18n/icu_util.h"
#include "chrome/common/descriptors_android.h"
#else
// Diagnostics is only available on non-android platforms.
@@ -666,6 +667,20 @@ void ChromeMainDelegate::PreSandboxStartup() {
base::CPU cpu_info;
#endif
+#if defined(OS_ANDROID)
+ if (process_type.empty()) {
+ // Browser process loads ICU data using file names.
+ CHECK(base::i18n::InitializeICU());
+ } else {
+ // Render processes load ICU data using file descriptor.
+ int icu_data_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
+ kAndroidICUDataDescriptor);
+ CHECK(icu_data_fd != -1);
+ CHECK(base::i18n::InitializeICU(icu_data_fd));
+ }
+#endif
jungshik at Google 2014/06/05 23:40:38 What about other implementations of content_main_d
Feng Qian 2014/06/06 17:40:31 I can move logic into content_main_runner.cc. On
+
+
// Initialize the user data dir for any process type that needs it.
if (chrome::ProcessNeedsProfileDir(process_type))
InitializeUserDataDir();

Powered by Google App Engine
This is Rietveld 408576698