Commit 97d0c581 authored by Bob Owen's avatar Bob Owen Committed by Commit Bot

Remove dynamic load and call for GetUserDefaultLocaleName

This was only required because it is not available on Windows XP, which is no
longer supported.

R=forshaw@chromium.org

Bug: 821290
Change-Id: Ie5fba51391b25f7a1a01549f67a054c00aefa50f
Reviewed-on: https://chromium-review.googlesource.com/1012119Reviewed-by: default avatarJames Forshaw <forshaw@chromium.org>
Commit-Queue: James Forshaw <forshaw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551715}
parent 779dea58
...@@ -112,7 +112,6 @@ Bernhard M. Wiedemann <bwiedemann@suse.de> ...@@ -112,7 +112,6 @@ Bernhard M. Wiedemann <bwiedemann@suse.de>
Bhagirathi Satpathy <bhagirathi.s@samsung.com> Bhagirathi Satpathy <bhagirathi.s@samsung.com>
Bhanukrushana Rout <b.rout@samsung.com> Bhanukrushana Rout <b.rout@samsung.com>
Biljith Jayan <billy.jayan@samsung.com> Biljith Jayan <billy.jayan@samsung.com>
Bob Owen <bowen@mozilla.com>
Bobby Powers <bobbypowers@gmail.com> Bobby Powers <bobbypowers@gmail.com>
Branden Archer <bma4@zips.uakron.edu> Branden Archer <bma4@zips.uakron.edu>
Brendan Kirby <brendan.kirby@imgtec.com> Brendan Kirby <brendan.kirby@imgtec.com>
...@@ -955,6 +954,7 @@ LG Electronics, Inc. <*@lge.com> ...@@ -955,6 +954,7 @@ LG Electronics, Inc. <*@lge.com>
Loongson Technology Corporation Limited. <*@loongson.cn> Loongson Technology Corporation Limited. <*@loongson.cn>
Macadamian <*@macadamian.com> Macadamian <*@macadamian.com>
MIPS Technologies, Inc. <*@mips.com> MIPS Technologies, Inc. <*@mips.com>
Mozilla Corporation <*@mozilla.com>
Neverware Inc. <*@neverware.com> Neverware Inc. <*@neverware.com>
NIKE, Inc. <*@nike.com> NIKE, Inc. <*@nike.com>
NVIDIA Corporation <*@nvidia.com> NVIDIA Corporation <*@nvidia.com>
......
...@@ -79,11 +79,6 @@ bool CloseOpenHandles(bool* is_csrss_connected) { ...@@ -79,11 +79,6 @@ bool CloseOpenHandles(bool* is_csrss_connected) {
return true; return true;
} }
// GetUserDefaultLocaleName is not available on WIN XP. So we'll
// load it on-the-fly.
const wchar_t kKernel32DllName[] = L"kernel32.dll";
typedef decltype(GetUserDefaultLocaleName)* GetUserDefaultLocaleNameFunction;
// Warm up language subsystems before the sandbox is turned on. // Warm up language subsystems before the sandbox is turned on.
// Tested on Win8.1 x64: // Tested on Win8.1 x64:
// This needs to happen after RevertToSelf() is called, because (at least) in // This needs to happen after RevertToSelf() is called, because (at least) in
...@@ -96,23 +91,8 @@ bool WarmupWindowsLocales() { ...@@ -96,23 +91,8 @@ bool WarmupWindowsLocales() {
// warmup all of these functions, but let's not assume that. // warmup all of these functions, but let's not assume that.
::GetUserDefaultLangID(); ::GetUserDefaultLangID();
::GetUserDefaultLCID(); ::GetUserDefaultLCID();
static GetUserDefaultLocaleNameFunction GetUserDefaultLocaleName_func =
nullptr;
if (!GetUserDefaultLocaleName_func) {
HMODULE kernel32_dll = ::GetModuleHandle(kKernel32DllName);
if (!kernel32_dll) {
return false;
}
GetUserDefaultLocaleName_func =
reinterpret_cast<GetUserDefaultLocaleNameFunction>(
GetProcAddress(kernel32_dll, "GetUserDefaultLocaleName"));
if (!GetUserDefaultLocaleName_func) {
return false;
}
}
wchar_t localeName[LOCALE_NAME_MAX_LENGTH] = {0}; wchar_t localeName[LOCALE_NAME_MAX_LENGTH] = {0};
return (0 != GetUserDefaultLocaleName_func( return (0 != ::GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH));
localeName, LOCALE_NAME_MAX_LENGTH * sizeof(wchar_t)));
} }
// Used as storage for g_target_services, because other allocation facilities // Used as storage for g_target_services, because other allocation facilities
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment