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

Unified Diff: content/app/content_main_runner.cc

Issue 317833006: [ICU] Avoid reading ICU data files in render process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address reviewer's comments 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: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 8c767321132a4e139bebbc9c7303906a1dda3410..80041b4a984860d14bd0a9957dbe17eab1fb6a23 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -50,6 +50,10 @@
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
+#if defined(OS_ANDROID)
+#include "content/public/common/content_descriptors.h"
+#endif
+
#if defined(USE_TCMALLOC)
#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
#if defined(TYPE_PROFILING)
@@ -703,7 +707,20 @@ class ContentMainRunnerImpl : public ContentMainRunner {
RegisterPathProvider();
RegisterContentSchemes(true);
+#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));
+ }
+#else
+ CHECK(base::i18n::InitializeICU());
+#endif
InitializeStatsTable(command_line);

Powered by Google App Engine
This is Rietveld 408576698