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

Unified Diff: base/i18n/icu_util.cc

Issue 1076623004: Add temporary CHECKs in ICU init to attempt to more closely locate crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: #if win the checks Created 5 years, 8 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 8bbbc049e8ae2d3606d3781eef13d49e30b32ff1..76eaa62ff783ac8019cf41a4e8c0483950c14007 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -10,6 +10,7 @@
#include <string>
+#include "base/debug/alias.h"
#include "base/files/file_path.h"
#include "base/files/memory_mapped_file.h"
#include "base/logging.h"
@@ -130,6 +131,10 @@ bool InitializeICU() {
#if defined(OS_WIN)
// The data file will be in the same directory as the current module.
bool path_ok = PathService::Get(base::DIR_MODULE, &data_path);
+ wchar_t tmp_buffer[_MAX_PATH] = {0};
+ wcscpy_s(tmp_buffer, data_path.value().c_str());
+ base::debug::Alias(tmp_buffer);
+ CHECK(path_ok); // TODO(scottmg): http://crbug.com/445616
#elif defined(OS_ANDROID)
bool path_ok = PathService::Get(base::DIR_ANDROID_APP_DATA, &data_path);
#else
@@ -140,6 +145,14 @@ bool InitializeICU() {
#endif
DCHECK(path_ok);
data_path = data_path.AppendASCII(kIcuDataFileName);
+
+#if defined(OS_WIN)
+ // TODO(scottmg): http://crbug.com/445616
+ wchar_t tmp_buffer2[_MAX_PATH] = {0};
+ wcscpy_s(tmp_buffer2, data_path.value().c_str());
+ base::debug::Alias(tmp_buffer2);
+#endif
+
#else
// Assume it is in the framework bundle's Resources directory.
base::ScopedCFTypeRef<CFStringRef> data_file_name(
@@ -152,12 +165,18 @@ bool InitializeICU() {
}
#endif // OS check
if (!mapped_file.Initialize(data_path)) {
+#if defined(OS_WIN)
+ CHECK(false); // TODO(scottmg): http://crbug.com/445616
+#endif
LOG(ERROR) << "Couldn't mmap " << data_path.AsUTF8Unsafe();
return false;
}
}
UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(const_cast<uint8*>(mapped_file.data()), &err);
+#if defined(OS_WIN)
+ CHECK(err == U_ZERO_ERROR); // TODO(scottmg): http://crbug.com/445616
+#endif
return err == U_ZERO_ERROR;
#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