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

Unified Diff: base/ios/ios_util.mm

Issue 1568363002: [iOS] Allow overriding icuctl.dat file location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Less string copies Created 4 years, 11 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 | « base/ios/ios_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/ios/ios_util.mm
diff --git a/base/ios/ios_util.mm b/base/ios/ios_util.mm
index 627fb403e1980d7b482d848d4bfba846e0fec8ab..bc10d19e8f6a54931a38915f83d831e14f1597ac 100644
--- a/base/ios/ios_util.mm
+++ b/base/ios/ios_util.mm
@@ -11,6 +11,7 @@
#include "base/sys_info.h"
namespace {
+
// Return a 3 elements array containing the major, minor and bug fix version of
// the OS.
const int32_t* OSVersionAsArray() {
@@ -19,6 +20,9 @@ const int32_t* OSVersionAsArray() {
&digits[0], &digits[1], &digits[2]);
return digits;
}
+
+std::string* g_icudtl_path_override = nullptr;
+
} // namespace
namespace base {
@@ -48,5 +52,17 @@ bool IsInForcedRTL() {
return [defaults boolForKey:@"NSForceRightToLeftWritingDirection"];
}
+void OverridePathOfEmbeddedICU(const char* path) {
+ DCHECK(!g_icudtl_path_override);
+ g_icudtl_path_override = new std::string(path);
+}
+
+FilePath FilePathOfEmbeddedICU() {
+ if (g_icudtl_path_override) {
+ return FilePath(*g_icudtl_path_override);
+ }
+ return FilePath();
+}
+
} // namespace ios
} // namespace base
« no previous file with comments | « base/ios/ios_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698