Remove useless references to unsupported windows versions (1)
This CL goes over all directories excluding base/ chrome/ content/ components/ and ui/. Bug: 579196 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I4c792972b546b9de10669b7c3f66e85ab79cea94 Reviewed-on: https://chromium-review.googlesource.com/565897 Commit-Queue: Patrick Monette <pmonette@chromium.org> Reviewed-by: Chrome Cunningham <chcunningham@chromium.org> Reviewed-by: Ken Rockot <rockot@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: John Bauman <jbauman@chromium.org> Reviewed-by: Colin Blundell <blundell@chromium.org> Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org> Cr-Commit-Position: refs/heads/master@{#490593}
This commit is contained in:

committed by
Commit Bot

parent
fe4fa70360
commit
af4d0ad7d9
cloud_print/virtual_driver/win/port_monitor
gpu/config
media/audio/win
mojo/edk
rlz/win/lib
services/device/battery
@ -26,7 +26,6 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/win/registry.h"
|
||||
#include "base/win/scoped_handle.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/installer/launcher_support/chrome_launcher_support.h"
|
||||
#include "cloud_print/common/win/cloud_print_utils.h"
|
||||
@ -113,11 +112,7 @@ base::FilePath GetLocalAppDataLow() {
|
||||
}
|
||||
|
||||
base::FilePath GetAppDataDir() {
|
||||
base::FilePath file_path;
|
||||
if (base::win::GetVersion() >= base::win::VERSION_VISTA)
|
||||
file_path = GetLocalAppDataLow();
|
||||
else
|
||||
PathService::Get(base::DIR_LOCAL_APP_DATA, &file_path);
|
||||
base::FilePath file_path = GetLocalAppDataLow();
|
||||
if (file_path.empty()) {
|
||||
LOG(ERROR) << "Can't get app data dir";
|
||||
}
|
||||
@ -304,19 +299,15 @@ bool ValidateCurrentUser() {
|
||||
}
|
||||
base::win::ScopedHandle token_scoped(token);
|
||||
|
||||
if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
|
||||
DWORD session_id = 0;
|
||||
DWORD dummy;
|
||||
if (!GetTokenInformation(token_scoped.Get(), TokenSessionId,
|
||||
DWORD session_id = 0;
|
||||
DWORD dummy = 0;
|
||||
if (!::GetTokenInformation(token_scoped.Get(), TokenSessionId,
|
||||
reinterpret_cast<void*>(&session_id),
|
||||
sizeof(DWORD), &dummy)) {
|
||||
return false;
|
||||
}
|
||||
if (session_id == 0) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
return session_id != 0;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#include "base/win/scoped_com_initializer.h"
|
||||
#include "base/win/scoped_comptr.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "ui/gl/gl_implementation.h"
|
||||
#include "ui/gl/gl_surface_egl.h"
|
||||
|
||||
@ -84,18 +83,8 @@ CollectInfoResult CollectDriverInfoD3D(const std::wstring& device_id,
|
||||
{0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}};
|
||||
|
||||
// create device info for the display device
|
||||
HDEVINFO device_info;
|
||||
if (base::win::GetVersion() <= base::win::VERSION_XP) {
|
||||
// Collection of information on all adapters is much slower on XP (almost
|
||||
// 100ms), and not very useful (as it's not going to use the GPU anyway), so
|
||||
// just collect information on the current device. http://crbug.com/456178
|
||||
device_info =
|
||||
SetupDiGetClassDevsW(NULL, device_id.c_str(), NULL,
|
||||
DIGCF_PRESENT | DIGCF_PROFILE | DIGCF_ALLCLASSES);
|
||||
} else {
|
||||
device_info =
|
||||
SetupDiGetClassDevsW(&display_class, NULL, NULL, DIGCF_PRESENT);
|
||||
}
|
||||
HDEVINFO device_info =
|
||||
::SetupDiGetClassDevs(&display_class, NULL, NULL, DIGCF_PRESENT);
|
||||
if (device_info == INVALID_HANDLE_VALUE) {
|
||||
LOG(ERROR) << "Creating device info failed";
|
||||
return kCollectInfoNonFatalFailure;
|
||||
|
@ -302,12 +302,6 @@ bool GPUTestBotConfig::CurrentConfigMatches(
|
||||
|
||||
// static
|
||||
bool GPUTestBotConfig::GpuBlacklistedOnBot() {
|
||||
#if defined(OS_WIN)
|
||||
// Blacklist rule #79 disables all Gpu acceleration before Windows 7.
|
||||
if (base::win::GetVersion() <= base::win::VERSION_VISTA) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -122,13 +122,7 @@ static int NumberOfWaveOutBuffers() {
|
||||
return buffers;
|
||||
}
|
||||
|
||||
// Use 4 buffers for Vista, 3 for everyone else:
|
||||
// - The entire Windows audio stack was rewritten for Windows Vista and wave
|
||||
// out performance was degraded compared to XP.
|
||||
// - The regression was fixed in Windows 7 and most configurations will work
|
||||
// with 2, but some (e.g., some Sound Blasters) still need 3.
|
||||
// - Some XP configurations (even multi-processor ones) also need 3.
|
||||
return (base::win::GetVersion() == base::win::VERSION_VISTA) ? 4 : 3;
|
||||
return 3;
|
||||
}
|
||||
|
||||
AudioManagerWin::AudioManagerWin(std::unique_ptr<AudioThread> audio_thread,
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "base/sync_socket.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/win/scoped_com_initializer.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "media/audio/audio_device_info_accessor_for_tests.h"
|
||||
#include "media/audio/audio_io.h"
|
||||
#include "media/audio/audio_manager.h"
|
||||
@ -452,11 +451,9 @@ TEST_F(WinAudioTest, PCMWaveStreamPlay200HzToneLowLatency) {
|
||||
audio_manager_device_info_->GetDefaultOutputStreamParameters();
|
||||
int sample_rate = params.sample_rate();
|
||||
uint32_t samples_10_ms = sample_rate / 100;
|
||||
int n = 1;
|
||||
(base::win::GetVersion() <= base::win::VERSION_XP) ? n = 5 : n = 1;
|
||||
AudioOutputStream* oas = audio_manager_->MakeAudioOutputStream(
|
||||
AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
|
||||
CHANNEL_LAYOUT_MONO, sample_rate, 16, n * samples_10_ms),
|
||||
CHANNEL_LAYOUT_MONO, sample_rate, 16, samples_10_ms),
|
||||
std::string(), AudioManager::LogCallback());
|
||||
ASSERT_TRUE(NULL != oas);
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "base/win/scoped_handle.h"
|
||||
#include "base/win/scoped_propvariant.h"
|
||||
#include "base/win/scoped_variant.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "media/audio/audio_device_description.h"
|
||||
#include "media/base/media_switches.h"
|
||||
|
||||
@ -204,12 +203,6 @@ static bool IsSupportedInternal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Microsoft does not plan to make the Core Audio APIs available for use
|
||||
// with earlier versions of Windows, including Microsoft Windows Server 2003,
|
||||
// Windows XP, Windows Millennium Edition, Windows 2000, and Windows 98.
|
||||
if (base::win::GetVersion() < base::win::VERSION_VISTA)
|
||||
return false;
|
||||
|
||||
// The audio core APIs are implemented in the Mmdevapi.dll and Audioses.dll
|
||||
// system components.
|
||||
// Dependency Walker shows that it is enough to verify possibility to load
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "base/rand_util.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "mojo/edk/embedder/platform_handle.h"
|
||||
|
||||
namespace mojo {
|
||||
@ -113,8 +112,7 @@ PlatformChannelPair::PrepareToPassClientHandleToChildProcessAsString(
|
||||
DCHECK(handle_passing_info);
|
||||
DCHECK(client_handle_.is_valid());
|
||||
|
||||
if (base::win::GetVersion() >= base::win::VERSION_VISTA)
|
||||
handle_passing_info->push_back(client_handle_.get().handle);
|
||||
handle_passing_info->push_back(client_handle_.get().handle);
|
||||
|
||||
return base::IntToString(HandleToLong(client_handle_.get().handle));
|
||||
}
|
||||
|
@ -33,9 +33,7 @@
|
||||
#include "mojo/edk/embedder/platform_channel_pair.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/win/windows_version.h"
|
||||
#elif defined(OS_MACOSX) && !defined(OS_IOS)
|
||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
||||
#include "base/mac/mach_port_broker.h"
|
||||
#endif
|
||||
|
||||
|
@ -25,9 +25,6 @@ HRESULT GetElevationType(PTOKEN_ELEVATION_TYPE elevation) {
|
||||
|
||||
*elevation = TokenElevationTypeDefault;
|
||||
|
||||
if (base::win::GetVersion() < base::win::VERSION_VISTA)
|
||||
return E_FAIL;
|
||||
|
||||
HANDLE process_token;
|
||||
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &process_token))
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
@ -45,39 +42,6 @@ HRESULT GetElevationType(PTOKEN_ELEVATION_TYPE elevation) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// based on http://msdn2.microsoft.com/en-us/library/aa376389.aspx
|
||||
bool GetUserGroup(long* group) {
|
||||
if (!group)
|
||||
return false;
|
||||
|
||||
*group = 0;
|
||||
|
||||
// groups are listed in DECREASING order of importance
|
||||
// (eg. If a user is a member of both the admin group and
|
||||
// the power user group, it is more useful to list the user
|
||||
// as an admin)
|
||||
DWORD user_groups[] = {DOMAIN_ALIAS_RID_ADMINS,
|
||||
DOMAIN_ALIAS_RID_POWER_USERS};
|
||||
SID_IDENTIFIER_AUTHORITY nt_authority = {SECURITY_NT_AUTHORITY};
|
||||
|
||||
for (size_t i = 0; i < arraysize(user_groups) && *group == 0; ++i) {
|
||||
PSID current_group;
|
||||
if (AllocateAndInitializeSid(&nt_authority, 2,
|
||||
SECURITY_BUILTIN_DOMAIN_RID,
|
||||
user_groups[i], 0, 0, 0, 0,
|
||||
0, 0, ¤t_group)) {
|
||||
BOOL current_level;
|
||||
if (CheckTokenMembership(NULL, current_group, ¤t_level) &&
|
||||
current_level) {
|
||||
*group = user_groups[i];
|
||||
}
|
||||
|
||||
FreeSid(current_group);
|
||||
}
|
||||
}
|
||||
|
||||
return group != 0;
|
||||
}
|
||||
} //anonymous
|
||||
|
||||
|
||||
@ -99,7 +63,7 @@ bool ProcessInfo::HasAdminRights() {
|
||||
if (!evaluated) {
|
||||
if (IsRunningAsSystem()) {
|
||||
has_rights = true;
|
||||
} else if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
|
||||
} else {
|
||||
TOKEN_ELEVATION_TYPE elevation;
|
||||
if (SUCCEEDED(GetElevationType(&elevation))) {
|
||||
base::IntegrityLevel level = base::GetCurrentProcessIntegrityLevel();
|
||||
@ -108,10 +72,6 @@ bool ProcessInfo::HasAdminRights() {
|
||||
(level == base::HIGH_INTEGRITY);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
long group = 0;
|
||||
if (GetUserGroup(&group))
|
||||
has_rights = (group == DOMAIN_ALIAS_RID_ADMINS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,9 +58,6 @@ bool HasUserKeyAccess(bool write_access) {
|
||||
}
|
||||
|
||||
if (write_access) {
|
||||
if (base::win::GetVersion() < base::win::VERSION_VISTA)
|
||||
return true;
|
||||
|
||||
if (base::GetCurrentProcessIntegrityLevel() <= base::LOW_INTEGRITY) {
|
||||
ASSERT_STRING("UserKey::HasAccess: Cannot write from Low Integrity.");
|
||||
return false;
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "base/win/message_window.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "services/device/battery/battery_status_manager.h"
|
||||
|
||||
namespace device {
|
||||
@ -120,17 +119,11 @@ class BatteryStatusObserver {
|
||||
}
|
||||
|
||||
HPOWERNOTIFY RegisterNotification(LPCGUID power_setting) {
|
||||
if (base::win::GetVersion() < base::win::VERSION_VISTA)
|
||||
return NULL;
|
||||
|
||||
return RegisterPowerSettingNotification(window_->hwnd(), power_setting,
|
||||
DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||
}
|
||||
|
||||
BOOL UnregisterNotification(HPOWERNOTIFY handle) {
|
||||
if (base::win::GetVersion() < base::win::VERSION_VISTA)
|
||||
return FALSE;
|
||||
|
||||
return UnregisterPowerSettingNotification(handle);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user