Skip to content

Commit 0a07797

Browse files
jungshikSlow3000
authored andcommitted
<chromium> [Backport] Enable icu_use_data_file on Windows
BUG=72633,337116 Review URL: https://codereview.chromium.org/99473012 Change-Id: I70c2a17ec8a69542c850089b09e19c5873470a1a Reviewed-by: Michael Bruning <[email protected]>
1 parent f004bde commit 0a07797

File tree

4 files changed

+38
-21
lines changed

4 files changed

+38
-21
lines changed

chromium/base/base.gyp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -795,11 +795,6 @@
795795
},
796796
],
797797
['OS == "win"', {
798-
# This is needed to trigger the dll copy step on windows.
799-
# TODO(mark): This should not be necessary.
800-
'dependencies': [
801-
'../third_party/icu/icu.gyp:icudata',
802-
],
803798
'sources!': [
804799
'file_descriptor_shuffle_unittest.cc',
805800
'files/dir_reader_posix_unittest.cc',
@@ -810,17 +805,24 @@
810805
'msvs_disabled_warnings': [
811806
4267,
812807
],
813-
# This is needed so base_unittests uses the allocator shim, as
814-
# SecurityTest.MemoryAllocationRestriction* tests are dependent
815-
# on tcmalloc.
816-
# TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into
817-
# their own test suite.
818808
'conditions': [
809+
# This is needed so base_unittests uses the allocator shim, as
810+
# SecurityTest.MemoryAllocationRestriction* tests are dependent
811+
# on tcmalloc.
812+
# TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into
813+
# their own test suite.
819814
['win_use_allocator_shim==1', {
820815
'dependencies': [
821816
'allocator/allocator.gyp:allocator',
822817
],
823818
}],
819+
['icu_use_data_file_flag==0', {
820+
# This is needed to trigger the dll copy step on windows.
821+
# TODO(mark): This should not be necessary.
822+
'dependencies': [
823+
'../third_party/icu/icu.gyp:icudata',
824+
],
825+
}],
824826
],
825827
}, { # OS != "win"
826828
'dependencies': [

chromium/base/i18n/icu_util.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,16 @@ bool InitializeICU() {
8888
if (!mapped_file.IsValid()) {
8989
// Assume it is in the framework bundle's Resources directory.
9090
#if !defined(OS_MACOSX)
91+
FilePath data_path;
92+
#if defined(OS_WIN)
93+
// The data file will be in the same directory as the current module.
94+
bool path_ok = PathService::Get(base::DIR_MODULE, &data_path);
95+
#else
9196
// For now, expect the data file to be alongside the executable.
9297
// This is sufficient while we work on unit tests, but will eventually
9398
// likely live in a data directory.
94-
FilePath data_path;
9599
bool path_ok = PathService::Get(base::DIR_EXE, &data_path);
100+
#endif
96101
DCHECK(path_ok);
97102
data_path = data_path.AppendASCII(ICU_UTIL_DATA_FILE_NAME);
98103
#else
@@ -104,7 +109,7 @@ bool InitializeICU() {
104109
}
105110
#endif // OS check
106111
if (!mapped_file.Initialize(data_path)) {
107-
DLOG(ERROR) << "Couldn't mmap " << data_path.value();
112+
DLOG(ERROR) << "Couldn't mmap " << data_path.AsUTF8Unsafe();
108113
return false;
109114
}
110115
}

chromium/build/common.gypi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,7 @@
12801280
}],
12811281
['OS=="win"', {
12821282
'windows_driver_kit_path%': '$(WDK_DIR)',
1283+
'icu_use_data_file_flag%': 1,
12831284
# Set the python arch to prevent conflicts with pyauto on Win64 build.
12841285
# TODO(jschuh): crbug.com/177664 Investigate Win64 pyauto build.
12851286
'python_arch%': 'ia32',

chromium/net/net.gyp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,14 +2188,20 @@
21882188
'dns/dns_config_service_posix_unittest.cc',
21892189
'http/http_auth_gssapi_posix_unittest.cc',
21902190
],
2191-
# This is needed to trigger the dll copy step on windows.
2192-
# TODO(mark): Specifying this here shouldn't be necessary.
21932191
'dependencies': [
2194-
'../third_party/icu/icu.gyp:icudata',
21952192
'../third_party/nss/nss.gyp:nspr',
21962193
'../third_party/nss/nss.gyp:nss',
21972194
'third_party/nss/ssl.gyp:libssl',
21982195
],
2196+
'conditions': [
2197+
[ 'icu_use_data_file_flag == 0', {
2198+
# This is needed to trigger the dll copy step on windows.
2199+
# TODO(mark): Specifying this here shouldn't be necessary.
2200+
'dependencies': [
2201+
'../third_party/icu/icu.gyp:icudata',
2202+
],
2203+
}],
2204+
],
21992205
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
22002206
'msvs_disabled_warnings': [4267, ],
22012207
},
@@ -2294,16 +2300,19 @@
22942300
],
22952301
},
22962302
],
2297-
# This is needed to trigger the dll copy step on windows.
2298-
# TODO(mark): Specifying this here shouldn't be necessary.
22992303
[ 'OS == "win"', {
2300-
'dependencies': [
2301-
'../third_party/icu/icu.gyp:icudata',
2304+
'conditions': [
2305+
[ 'icu_use_data_file_flag == 0', {
2306+
# This is needed to trigger the dll copy step on windows.
2307+
# TODO(mark): Specifying this here shouldn't be necessary.
2308+
'dependencies': [
2309+
'../third_party/icu/icu.gyp:icudata',
2310+
],
2311+
}],
23022312
],
23032313
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
23042314
'msvs_disabled_warnings': [4267, ],
2305-
},
2306-
],
2315+
}],
23072316
],
23082317
},
23092318
{

0 commit comments

Comments
 (0)