summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-24 01:00:41 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-24 01:00:41 +0000
commit27be5064de59003547d02489cda61caaee56b031 (patch)
tree2c5ffbda3f70255da36bd9dfbd1285a91874f1fc
parentfea05b4d9fb69f2cf367d9bc18c53700b9c5cff3 (diff)
downloadchromium_src-27be5064de59003547d02489cda61caaee56b031.zip
chromium_src-27be5064de59003547d02489cda61caaee56b031.tar.gz
chromium_src-27be5064de59003547d02489cda61caaee56b031.tar.bz2
Enable icu_use_data_file on Windows
Set icu_use_data_file_flag to 1 on Windows in common.gypi and make the dependency on icudata conditional on 'icu_use_data_file_flag != 0' in common.gypi, base.gyp and net.gyp Add icudtl.dat to the Windows build/archive/install file lists. Load icudtl.dat from DIR_MODULE instead of DIR_EXE on Windows. (to fix bug 337116) This also requires a change in third_party/icu/icu.gyp ( https://codereview.chromium.org/111723007/ ), which was rolled in by https://codereview.chromium.org/118313004/ BUG=72633,337116 TEST=All windows builds work fine and there's no perf regression (start-up etc). Chrome installed via mini_installer runs fine (no issue with icu data file). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=246387 Review URL: https://codereview.chromium.org/99473012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246751 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/base.gyp22
-rw-r--r--base/i18n/icu_util.cc9
-rw-r--r--build/common.gypi1
-rw-r--r--chrome/installer/mini_installer.gyp10
-rw-r--r--chrome/installer/mini_installer.gypi10
-rw-r--r--chrome/installer/mini_installer/chrome.release1
-rw-r--r--chrome/tools/build/win/FILES.cfg6
-rw-r--r--chrome/tools/build/win/TESTS1
-rw-r--r--net/net.gyp27
9 files changed, 64 insertions, 23 deletions
diff --git a/base/base.gyp b/base/base.gyp
index a989933..1a41812 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -761,11 +761,6 @@
},
],
['OS == "win"', {
- # This is needed to trigger the dll copy step on windows.
- # TODO(mark): This should not be necessary.
- 'dependencies': [
- '../third_party/icu/icu.gyp:icudata',
- ],
'sources!': [
'file_descriptor_shuffle_unittest.cc',
'files/dir_reader_posix_unittest.cc',
@@ -776,17 +771,24 @@
'msvs_disabled_warnings': [
4267,
],
- # This is needed so base_unittests uses the allocator shim, as
- # SecurityTest.MemoryAllocationRestriction* tests are dependent
- # on tcmalloc.
- # TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into
- # their own test suite.
'conditions': [
+ # This is needed so base_unittests uses the allocator shim, as
+ # SecurityTest.MemoryAllocationRestriction* tests are dependent
+ # on tcmalloc.
+ # TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into
+ # their own test suite.
['win_use_allocator_shim==1', {
'dependencies': [
'allocator/allocator.gyp:allocator',
],
}],
+ ['icu_use_data_file_flag==0', {
+ # This is needed to trigger the dll copy step on windows.
+ # TODO(mark): This should not be necessary.
+ 'dependencies': [
+ '../third_party/icu/icu.gyp:icudata',
+ ],
+ }],
],
}, { # OS != "win"
'dependencies': [
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
index 6ba925d..5fa37f8 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -90,11 +90,16 @@ bool InitializeICU() {
CR_DEFINE_STATIC_LOCAL(base::MemoryMappedFile, mapped_file, ());
if (!mapped_file.IsValid()) {
#if !defined(OS_MACOSX)
+ FilePath data_path;
+#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);
+#else
// For now, expect the data file to be alongside the executable.
// This is sufficient while we work on unit tests, but will eventually
// likely live in a data directory.
- FilePath data_path;
bool path_ok = PathService::Get(base::DIR_EXE, &data_path);
+#endif
DCHECK(path_ok);
data_path = data_path.AppendASCII(ICU_UTIL_DATA_FILE_NAME);
#else
@@ -107,7 +112,7 @@ bool InitializeICU() {
}
#endif // OS check
if (!mapped_file.Initialize(data_path)) {
- DLOG(ERROR) << "Couldn't mmap " << data_path.value();
+ DLOG(ERROR) << "Couldn't mmap " << data_path.AsUTF8Unsafe();
return false;
}
}
diff --git a/build/common.gypi b/build/common.gypi
index 90b08a7..99949e9 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1287,6 +1287,7 @@
}],
['OS=="win"', {
'windows_driver_kit_path%': '$(WDK_DIR)',
+ 'icu_use_data_file_flag%': 1,
}],
['os_posix==1 and OS!="mac" and OS!="ios"', {
'conditions': [
diff --git a/chrome/installer/mini_installer.gyp b/chrome/installer/mini_installer.gyp
index 385c930..a7be6a6 100644
--- a/chrome/installer/mini_installer.gyp
+++ b/chrome/installer/mini_installer.gyp
@@ -223,6 +223,15 @@
'target_arch_flag': '--target_arch=x86',
},
}],
+ ['icu_use_data_file_flag == 0', {
+ 'inputs': [
+ '<(PRODUCT_DIR)/icudt.dll',
+ ],
+ }, { # else icu_use_data_file_flag != 0
+ 'inputs': [
+ '<(PRODUCT_DIR)/icudtl.dat',
+ ],
+ }],
],
'inputs': [
'<(create_installer_archive_py_path)',
@@ -233,7 +242,6 @@
'<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
'<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
'<(PRODUCT_DIR)/locales/en-US.pak',
- '<(PRODUCT_DIR)/icudt.dll',
],
'outputs': [
# Also note that chrome.packed.7z is defined as an output in a
diff --git a/chrome/installer/mini_installer.gypi b/chrome/installer/mini_installer.gypi
index 72e5047..6f2402d 100644
--- a/chrome/installer/mini_installer.gypi
+++ b/chrome/installer/mini_installer.gypi
@@ -185,6 +185,15 @@
'target_arch_flag': '--target_arch=x86',
},
}],
+ ['icu_use_data_file_flag == 0', {
+ 'inputs': [
+ '<(PRODUCT_DIR)/icudt.dll',
+ ],
+ }, { # else icu_use_data_file_flag != 0
+ 'inputs': [
+ '<(PRODUCT_DIR)/icudtl.dat',
+ ],
+ }],
],
'inputs': [
'<(create_installer_archive_py_path)',
@@ -195,7 +204,6 @@
'<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
'<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
'<(PRODUCT_DIR)/locales/en-US.pak',
- '<(PRODUCT_DIR)/icudt.dll',
],
'outputs': [
'xxx.out',
diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release
index c12e7b5..39d2e17 100644
--- a/chrome/installer/mini_installer/chrome.release
+++ b/chrome/installer/mini_installer/chrome.release
@@ -26,6 +26,7 @@ D3DCompiler_43.dll: %(VersionDir)s\
d3dcompiler_46.dll: %(VersionDir)s\
ffmpegsumo.dll: %(VersionDir)s\
icudt.dll: %(VersionDir)s\
+icudtl.dat: %(VersionDir)s\
libEGL.dll: %(VersionDir)s\
libGLESv2.dll: %(VersionDir)s\
nacl64.exe: %(VersionDir)s\
diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg
index d829eb6..7c1defd 100644
--- a/chrome/tools/build/win/FILES.cfg
+++ b/chrome/tools/build/win/FILES.cfg
@@ -95,8 +95,14 @@ FILES = [
'buildtype': ['dev', 'official'],
},
{
+ 'filename': 'icudtl.dat',
+ 'buildtype': ['dev', 'official'],
+ 'optional': ['dev', 'official'],
+ },
+ {
'filename': 'icudt.dll',
'buildtype': ['dev', 'official'],
+ 'optional': ['dev', 'official'],
},
{
'filename': 'libpeerconnection.dll',
diff --git a/chrome/tools/build/win/TESTS b/chrome/tools/build/win/TESTS
index 708ae53..7b18894 100644
--- a/chrome/tools/build/win/TESTS
+++ b/chrome/tools/build/win/TESTS
@@ -4,5 +4,6 @@ icudt38.dll
icudt42.dll
icudt46.dll
icudt.dll
+icudtl.dat
plugins\npTestNetscapePlugIn.dll
fonts\*
diff --git a/net/net.gyp b/net/net.gyp
index 9b10a414..a40f393 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -2235,14 +2235,20 @@
'dns/dns_config_service_posix_unittest.cc',
'http/http_auth_gssapi_posix_unittest.cc',
],
- # This is needed to trigger the dll copy step on windows.
- # TODO(mark): Specifying this here shouldn't be necessary.
'dependencies': [
- '../third_party/icu/icu.gyp:icudata',
'../third_party/nss/nss.gyp:nspr',
'../third_party/nss/nss.gyp:nss',
'third_party/nss/ssl.gyp:libssl',
],
+ 'conditions': [
+ [ 'icu_use_data_file_flag == 0', {
+ # This is needed to trigger the dll copy step on windows.
+ # TODO(mark): Specifying this here shouldn't be necessary.
+ 'dependencies': [
+ '../third_party/icu/icu.gyp:icudata',
+ ],
+ }],
+ ],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],
},
@@ -2341,16 +2347,19 @@
],
},
],
- # This is needed to trigger the dll copy step on windows.
- # TODO(mark): Specifying this here shouldn't be necessary.
[ 'OS == "win"', {
- 'dependencies': [
- '../third_party/icu/icu.gyp:icudata',
+ 'conditions': [
+ [ 'icu_use_data_file_flag == 0', {
+ # This is needed to trigger the dll copy step on windows.
+ # TODO(mark): Specifying this here shouldn't be necessary.
+ 'dependencies': [
+ '../third_party/icu/icu.gyp:icudata',
+ ],
+ }],
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],
- },
- ],
+ }],
],
},
{