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

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: Rohit comments 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..515562db0332a2198548e22606ddc15ff62c23fb 100644
--- a/base/ios/ios_util.mm
+++ b/base/ios/ios_util.mm
@@ -7,6 +7,7 @@
#import <Foundation/Foundation.h>
#include <stddef.h>
+#include "base/mac/foundation_util.h"
#include "base/macros.h"
#include "base/sys_info.h"
@@ -19,6 +20,9 @@ const int32_t* OSVersionAsArray() {
&digits[0], &digits[1], &digits[2]);
return digits;
}
+
+static NSString* g_icudtl_path_override = nil;
Mark Mentovai 2016/01/08 18:03:20 You don’t need static, you’re already in an unname
justincohen 2016/01/08 18:16:52 Done.
+
} // namespace
namespace base {
@@ -48,5 +52,14 @@ bool IsInForcedRTL() {
return [defaults boolForKey:@"NSForceRightToLeftWritingDirection"];
}
+void OverridePathOfEmbeddedICU(const char* path) {
+ DCHECK(!g_icudtl_path_override);
+ g_icudtl_path_override = [[NSString stringWithUTF8String:path] copy];
Mark Mentovai 2016/01/08 18:03:20 Why are you saving this as an NSString* when it’s
justincohen 2016/01/08 18:16:52 Done.
+}
+
+FilePath FilePathOfEmbeddedICU() {
+ return base::mac::NSStringToFilePath(g_icudtl_path_override);
+}
+
} // 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