diff --git a/ipc/chromium/src/base/message_pump_win.cc b/ipc/chromium/src/base/message_pump_win.cc index f8d2f48196d6..530958b358a8 100644 --- a/ipc/chromium/src/base/message_pump_win.cc +++ b/ipc/chromium/src/base/message_pump_win.cc @@ -150,17 +150,11 @@ void MessagePumpForUI::PumpOutPendingPaintMessages() { // to get the job done. Actual common max is 4 peeks, but we'll be a little // safe here. const int kMaxPeekCount = 20; - bool win2k = win_util::GetWinVersion() <= win_util::WINVERSION_2000; int peek_count; for (peek_count = 0; peek_count < kMaxPeekCount; ++peek_count) { MSG msg; - if (win2k) { - if (!PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE)) - break; - } else { - if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE | PM_QS_PAINT)) - break; - } + if (!PeekMessage(&msg, NULL, 0, 0, PM_REMOVE | PM_QS_PAINT)) + break; ProcessMessageHelper(msg); if (state_->should_quit) // Handle WM_QUIT. break; diff --git a/ipc/chromium/src/base/platform_thread_win.cc b/ipc/chromium/src/base/platform_thread_win.cc index beac77a05dca..35f4b90e9617 100644 --- a/ipc/chromium/src/base/platform_thread_win.cc +++ b/ipc/chromium/src/base/platform_thread_win.cc @@ -70,7 +70,7 @@ void PlatformThread::SetName(const char* name) { bool PlatformThread::Create(size_t stack_size, Delegate* delegate, PlatformThreadHandle* thread_handle) { unsigned int flags = 0; - if (stack_size > 0 && win_util::GetWinVersion() >= win_util::WINVERSION_XP) { + if (stack_size > 0) { flags = STACK_SIZE_PARAM_IS_A_RESERVATION; } else { stack_size = 0; diff --git a/ipc/chromium/src/base/process_util_win.cc b/ipc/chromium/src/base/process_util_win.cc index a81da5b6529c..b01488c17762 100644 --- a/ipc/chromium/src/base/process_util_win.cc +++ b/ipc/chromium/src/base/process_util_win.cc @@ -19,6 +19,8 @@ #include #include "prenv.h" +#include "mozilla/WindowsVersion.h" + namespace { // System pagesize. This value remains constant on x86/64 architectures. @@ -294,7 +296,7 @@ bool LaunchApp(const std::wstring& cmdline, LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList = NULL; // Don't even bother trying pre-Vista... - if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) { + if (mozilla::IsVistaOrLater()) { // setup our handle array first - if we end up with no handles that can // be inherited we can avoid trying to do the ThreadAttributeList dance... HANDLE handlesToInherit[2]; diff --git a/ipc/chromium/src/base/win_util.cc b/ipc/chromium/src/base/win_util.cc index c52449f89b5f..d0985d85d09e 100644 --- a/ipc/chromium/src/base/win_util.cc +++ b/ipc/chromium/src/base/win_util.cc @@ -15,45 +15,6 @@ namespace win_util { -WinVersion GetWinVersion() { - static bool checked_version = false; - static WinVersion win_version = WINVERSION_PRE_2000; - if (!checked_version) { - OSVERSIONINFOEX version_info; - version_info.dwOSVersionInfoSize = sizeof version_info; - GetVersionEx(reinterpret_cast(&version_info)); - if (version_info.dwMajorVersion == 5) { - switch (version_info.dwMinorVersion) { - case 0: - win_version = WINVERSION_2000; - break; - case 1: - win_version = WINVERSION_XP; - break; - case 2: - default: - win_version = WINVERSION_SERVER_2003; - break; - } - } else if (version_info.dwMajorVersion == 6) { - if (version_info.wProductType != VER_NT_WORKSTATION) { - // 2008 is 6.0, and 2008 R2 is 6.1. - win_version = WINVERSION_2008; - } else { - if (version_info.dwMinorVersion == 0) { - win_version = WINVERSION_VISTA; - } else { - win_version = WINVERSION_WIN7; - } - } - } else if (version_info.dwMajorVersion > 6) { - win_version = WINVERSION_WIN7; - } - checked_version = true; - } - return win_version; -} - bool IsShiftPressed() { return (::GetKeyState(VK_SHIFT) & 0x80) == 0x80; } diff --git a/ipc/chromium/src/base/win_util.h b/ipc/chromium/src/base/win_util.h index 5bfa818ceebc..cc1799f16982 100644 --- a/ipc/chromium/src/base/win_util.h +++ b/ipc/chromium/src/base/win_util.h @@ -14,22 +14,6 @@ namespace win_util { -// NOTE: Keep these in order so callers can do things like -// "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, -// though. -enum WinVersion { - WINVERSION_PRE_2000 = 0, // Not supported - WINVERSION_2000 = 1, - WINVERSION_XP = 2, - WINVERSION_SERVER_2003 = 3, - WINVERSION_VISTA = 4, - WINVERSION_2008 = 5, - WINVERSION_WIN7 = 6 -}; - -// Returns the running version of Windows. -WinVersion GetWinVersion(); - // Returns true if the shift key is currently pressed. bool IsShiftPressed();