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

Unified Diff: base/i18n/icu_util.cc

Issue 1802713002: Capture more details about failure to load ICU data file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non win Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/icu_util.cc
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
index 199f14765d78cae876626e4c4fad3a746167446f..744762b0dde2efa26ec327467c5371efa8c1a63f 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -63,6 +63,8 @@ bool g_called_once = false;
// To debug http://crbug.com/445616.
int g_debug_icu_last_error;
int g_debug_icu_load;
+int g_debug_icu_pf_last_error;
+int g_debug_icu_pf_error_details;
#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
// Use an unversioned file name to simplify a icu version update down the road.
@@ -145,9 +147,20 @@ void LazyInitIcuDataFile() {
#endif // !defined(OS_MACOSX)
File file(data_path, File::FLAG_OPEN | File::FLAG_READ);
if (file.IsValid()) {
+ // TODO(scottmg): http://crbug.com/445616.
+ g_debug_icu_pf_last_error = 0;
+ g_debug_icu_pf_error_details = 0;
+
g_icudtl_pf = file.TakePlatformFile();
g_icudtl_region = MemoryMappedFile::Region::kWholeFile;
}
+#if defined(OS_WIN)
+ else {
+ // TODO(scottmg): http://crbug.com/445616.
+ g_debug_icu_pf_last_error = ::GetLastError();
+ g_debug_icu_pf_error_details = file.error_details();
+ }
+#endif // OS_WIN
}
bool InitializeICUWithFileDescriptorInternal(
@@ -272,6 +285,10 @@ bool InitializeICU() {
debug::Alias(&debug_icu_load);
int debug_icu_last_error = g_debug_icu_last_error;
debug::Alias(&debug_icu_last_error);
+ int debug_icu_pf_last_error = g_debug_icu_pf_last_error;
+ debug::Alias(&debug_icu_pf_last_error);
+ int debug_icu_pf_error_details = g_debug_icu_pf_error_details;
+ debug::Alias(&debug_icu_pf_error_details);
CHECK(result); // TODO(scottmg): http://crbug.com/445616
#endif
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698