Changeset 80693 in webkit


Ignore:
Timestamp:
Mar 9, 2011 10:31:32 PM (13 years ago)
Author:
pkasting@chromium.org
Message:

Add UA string tags for Windows 64.
https://bugs.webkit.org/show_bug.cgi?id=55226

Reviewed by Ryosuke Niwa.

  • StringsNotToBeLocalized.txt:
  • platform/win/SystemInfo.cpp:

(WebCore::osVersionForUAString):
(WebCore::isWOW64):
(WebCore::processorArchitecture):
(WebCore::architectureTokenForUAString):
(WebCore::windowsVersionForUAString):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80690 r80693  
     12011-03-09  Peter Kasting  <pkasting@google.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Add UA string tags for Windows 64.
     6        https://bugs.webkit.org/show_bug.cgi?id=55226
     7
     8        * StringsNotToBeLocalized.txt:
     9        * platform/win/SystemInfo.cpp:
     10        (WebCore::osVersionForUAString):
     11        (WebCore::isWOW64):
     12        (WebCore::processorArchitecture):
     13        (WebCore::architectureTokenForUAString):
     14        (WebCore::windowsVersionForUAString):
     15
    1162011-03-09  Peter Kasting  <pkasting@google.com>
    217
  • trunk/Source/WebCore/StringsNotToBeLocalized.txt

    r80688 r80693  
    100100":/?#"
    101101"; "
     102"; WOW64"
     103"; Win64; x64"
     104"; Win64; IA64"
    102105"<!"
    103106"<%@ %@>"
     
    512515"WebWorkersPrivate"
    513516"Windows "
    514 "Windows CE"
    515 "Windows CE "
    516 "Windows CE .NET"
    517517"Windows 3.1"
    518518"Windows 95"
    519519"Windows 98"
    520520"Windows 98; Win 9x 4.90"
     521"Windows CE"
     522"Windows CE "
     523"Windows CE .NET"
     524"Windows NT "
    521525"WinNT4.0"
    522 "Windows NT "
    523526"WmvPlugin"
    524527"XSL"
     
    688691"jpeg"
    689692"js"
     693"kernel32.dll"
    690694"kioskmode"
    691695"ks_c_5601-1987"
  • trunk/Source/WebCore/platform/win/SystemInfo.cpp

    r80689 r80693  
    8787}
    8888
    89 String windowsVersionForUAString()
     89static String osVersionForUAString()
    9090{
    9191    int major, minor;
     
    114114}
    115115
     116static bool isWOW64()
     117{
     118    static bool initialized = false;
     119    static bool wow64 = false;
     120
     121    if (!initialized) {
     122        initialized = true;
     123        HMODULE kernel32Module = GetModuleHandleA("kernel32.dll");
     124        if (!kernel32Module)
     125            return wow64;
     126        typedef BOOL (WINAPI* IsWow64ProcessFunc)(HANDLE, PBOOL);
     127        IsWow64ProcessFunc isWOW64Process = reinterpret_cast<IsWow64ProcessFunc>(GetProcAddress(kernel32Module, "IsWow64Process"));
     128        if (isWOW64Process) {
     129            BOOL result = FALSE;
     130            wow64 = isWOW64Process(GetCurrentProcess(), &result) && result;
     131        }
     132    }
     133
     134    return wow64;
     135}
     136
     137static WORD processorArchitecture()
     138{
     139    static bool initialized = false;
     140    static WORD architecture = PROCESSOR_ARCHITECTURE_INTEL;
     141
     142    if (!initialized) {
     143        initialized = true;
     144        HMODULE kernel32Module = GetModuleHandleA("kernel32.dll");
     145        if (!kernel32Module)
     146            return architecture;
     147        typedef VOID (WINAPI* GetNativeSystemInfoFunc)(LPSYSTEM_INFO);
     148        GetNativeSystemInfoFunc getNativeSystemInfo = reinterpret_cast<GetNativeSystemInfoFunc>(GetProcAddress(kernel32Module, "GetNativeSystemInfo"));
     149        if (getNativeSystemInfo) {
     150            SYSTEM_INFO systemInfo = {0};
     151            getNativeSystemInfo(&systemInfo);
     152            architecture = systemInfo.wProcessorArchitecture;
     153        }
     154    }
     155
     156    return architecture;
     157}
     158
     159static String architectureTokenForUAString()
     160{
     161#if !OS(WINCE)
     162    if (isWOW64())
     163        return "; WOW64";
     164    if (processorArchitecture() == PROCESSOR_ARCHITECTURE_AMD64)
     165        return "; Win64; x64";
     166    if (processorArchitecture() == PROCESSOR_ARCHITECTURE_IA64)
     167        return "; Win64; IA64";
     168#endif
     169    return String();
     170}
     171
     172String windowsVersionForUAString()
     173{
     174    return makeString(osVersionForUAString(), architectureTokenForUAString());
     175}
     176
    116177} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.