Remove base::win::OSInfo::architecture().
Use GetArchitecture() instead. TBR=bbudge@chromium.org,piman@chromium.org Change-Id: Idaa14b959ee0d0d77c33b04e7af0d06889040f28 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1521311 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Antoine Labour <piman@chromium.org> Reviewed-by: Bill Budge <bbudge@chromium.org> Reviewed-by: Greg Thompson <grt@chromium.org> Cr-Commit-Position: refs/heads/master@{#640856}
This commit is contained in:
base
chrome
browser
conflicts
safe_browsing
chrome_cleaner
ui
webui
chrome_cleaner
install_static
test
cloud_print/virtual_driver/win
components/nacl/renderer
content
@ -54,8 +54,7 @@ bool PathProviderWin(int key, FilePath* result) {
|
||||
cur = FilePath(system_buffer);
|
||||
break;
|
||||
case base::DIR_PROGRAM_FILESX86:
|
||||
if (base::win::OSInfo::GetInstance()->architecture() !=
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
if (win::OSInfo::GetArchitecture() != win::OSInfo::X86_ARCHITECTURE) {
|
||||
if (FAILED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILESX86, NULL,
|
||||
SHGFP_TYPE_CURRENT, wsystem_buffer)))
|
||||
return false;
|
||||
|
@ -126,8 +126,6 @@ class BASE_EXPORT OSInfo {
|
||||
VersionType version_type() const { return version_type_; }
|
||||
ServicePack service_pack() const { return service_pack_; }
|
||||
std::string service_pack_str() const { return service_pack_str_; }
|
||||
// TODO(thestig): Switch callers to GetArchitecture().
|
||||
WindowsArchitecture architecture() const { return GetArchitecture(); }
|
||||
int processors() const { return processors_; }
|
||||
size_t allocation_granularity() const { return allocation_granularity_; }
|
||||
WOW64Status wow64_status() const { return wow64_status_; }
|
||||
|
@ -128,7 +128,7 @@ InstalledApplications::InstalledApplications(
|
||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
|
||||
|
||||
std::vector<std::pair<HKEY, REGSAM>> registry_key_combinations;
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
// On 32-bit Windows, there is only one view of the registry.
|
||||
registry_key_combinations.emplace_back(HKEY_CURRENT_USER, 0);
|
||||
|
@ -60,7 +60,7 @@ bool SRTPromptNeedsElevationIcon() {
|
||||
}
|
||||
|
||||
GURL GetStableDownloadURL() {
|
||||
const std::string url = base::win::OSInfo::GetInstance()->architecture() ==
|
||||
const std::string url = base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE
|
||||
? kSRTX86StableDownloadURL
|
||||
: kSRTX64StableDownloadURL;
|
||||
@ -74,7 +74,7 @@ GURL GetSRTDownloadURL() {
|
||||
if (download_group.empty())
|
||||
return GetStableDownloadURL();
|
||||
|
||||
std::string architecture = base::win::OSInfo::GetInstance()->architecture() ==
|
||||
std::string architecture = base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE
|
||||
? "x86"
|
||||
: "x64";
|
||||
|
@ -36,7 +36,7 @@ class SRTDownloadURLTest : public ::testing::Test {
|
||||
TEST_F(SRTDownloadURLTest, Stable) {
|
||||
CreatePromptTrial("On");
|
||||
std::string expected_path;
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
expected_path =
|
||||
"/dl/softwareremovaltool/win/x86/stable/chrome_cleanup_tool.exe";
|
||||
@ -50,7 +50,7 @@ TEST_F(SRTDownloadURLTest, Stable) {
|
||||
TEST_F(SRTDownloadURLTest, Experiment) {
|
||||
CreateDownloadFeature("experiment");
|
||||
std::string expected_path;
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
expected_path =
|
||||
"/dl/softwareremovaltool/win/x86/experiment/chrome_cleanup_tool.exe";
|
||||
@ -63,7 +63,7 @@ TEST_F(SRTDownloadURLTest, Experiment) {
|
||||
|
||||
TEST_F(SRTDownloadURLTest, DefaultsToStable) {
|
||||
std::string expected_path;
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
expected_path =
|
||||
"/dl/softwareremovaltool/win/x86/stable/chrome_cleanup_tool.exe";
|
||||
|
@ -197,7 +197,7 @@ void NaClDomHandler::AddOperatingSystemInfo(base::ListValue* list) {
|
||||
os_label += " SP" + base::NumberToString(os->service_pack().major);
|
||||
if (os->service_pack().minor > 0)
|
||||
os_label += "." + base::NumberToString(os->service_pack().minor);
|
||||
if (os->architecture() == base::win::OSInfo::X64_ARCHITECTURE)
|
||||
if (os->GetArchitecture() == base::win::OSInfo::X64_ARCHITECTURE)
|
||||
os_label += " 64 bit";
|
||||
#endif
|
||||
AddPair(list, l10n_util::GetStringUTF16(IDS_VERSION_UI_OS),
|
||||
|
@ -518,7 +518,7 @@ void GetOSAndCPU(UserAgent* user_agent) {
|
||||
user_agent->set_architecture(UserAgent::WOW64);
|
||||
} else {
|
||||
base::win::OSInfo::WindowsArchitecture windows_architecture =
|
||||
os_info->architecture();
|
||||
os_info->GetArchitecture();
|
||||
if (windows_architecture == base::win::OSInfo::X64_ARCHITECTURE)
|
||||
user_agent->set_architecture(UserAgent::X64);
|
||||
else if (windows_architecture == base::win::OSInfo::IA64_ARCHITECTURE)
|
||||
|
@ -243,7 +243,7 @@ base::FilePath AppendProductPath(const base::FilePath& base_path) {
|
||||
|
||||
base::FilePath GetX64ProgramFilesPath(const base::FilePath& input_path) {
|
||||
// On X86 system, there is no X64 program files folder, returns empty path.
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
return base::FilePath();
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ bool WhitelistSampleDLL(const base::FilePath& path) {
|
||||
TEST(DiskUtilTests, GetX64ProgramFilePath) {
|
||||
base::FilePath x64_program_files =
|
||||
GetX64ProgramFilesPath(base::FilePath(kProgramFilesBaseName));
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
EXPECT_TRUE(x64_program_files.empty());
|
||||
return;
|
||||
|
@ -122,7 +122,7 @@ bool IsWowRedirectionActive() {
|
||||
}
|
||||
|
||||
bool IsX64Architecture() {
|
||||
return base::win::OSInfo::GetInstance()->architecture() ==
|
||||
return base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X64_ARCHITECTURE;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ TEST(ProductInstallDetailsTest, PathIsInProgramFiles) {
|
||||
|
||||
// 32-bit on 32-bit: only check C:\Program Files.
|
||||
// 32-bit and 64-bit on 64-bit: check both.
|
||||
const bool is_x64 = base::win::OSInfo::GetInstance()->architecture() !=
|
||||
const bool is_x64 = base::win::OSInfo::GetArchitecture() !=
|
||||
base::win::OSInfo::X86_ARCHITECTURE;
|
||||
std::vector<int> program_files_keys;
|
||||
program_files_keys.push_back(base::DIR_PROGRAM_FILESX86);
|
||||
|
@ -285,9 +285,9 @@ class NaClBrowserTestPnaclDebug : public NaClBrowserTestPnacl {
|
||||
// (see note in chrome/browser/nacl_host/test/nacl_gdb_browsertest.cc)
|
||||
#if defined(OS_WIN)
|
||||
if (base::win::OSInfo::GetInstance()->wow64_status() ==
|
||||
base::win::OSInfo::WOW64_DISABLED &&
|
||||
base::win::OSInfo::GetInstance()->architecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
base::win::OSInfo::WOW64_DISABLED &&
|
||||
base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X86_ARCHITECTURE) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@ -47,7 +47,7 @@ HRESULT GetPrinterDriverDir(base::FilePath* path) {
|
||||
|
||||
bool IsSystem64Bit() {
|
||||
base::win::OSInfo::WindowsArchitecture arch =
|
||||
base::win::OSInfo::GetInstance()->architecture();
|
||||
base::win::OSInfo::GetArchitecture();
|
||||
return (arch == base::win::OSInfo::X64_ARCHITECTURE) ||
|
||||
(arch == base::win::OSInfo::IA64_ARCHITECTURE);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ const char* GetSandboxArch() {
|
||||
#if defined(OS_WIN)
|
||||
// We have to check the host architecture on Windows.
|
||||
// See sandbox_isa.h for an explanation why.
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X64_ARCHITECTURE) {
|
||||
return "x86-64";
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ TracingControllerImpl::GenerateMetadataDict() const {
|
||||
metadata_dict->SetString("os-version",
|
||||
base::SysInfo::OperatingSystemVersion());
|
||||
#if defined(OS_WIN)
|
||||
if (base::win::OSInfo::GetInstance()->architecture() ==
|
||||
if (base::win::OSInfo::GetArchitecture() ==
|
||||
base::win::OSInfo::X64_ARCHITECTURE) {
|
||||
if (base::win::OSInfo::GetInstance()->wow64_status() ==
|
||||
base::win::OSInfo::WOW64_ENABLED) {
|
||||
|
@ -77,7 +77,7 @@ std::string BuildOSCpuInfo(bool include_android_build_number) {
|
||||
architecture_token = "; WOW64";
|
||||
} else {
|
||||
base::win::OSInfo::WindowsArchitecture windows_architecture =
|
||||
os_info->architecture();
|
||||
os_info->GetArchitecture();
|
||||
if (windows_architecture == base::win::OSInfo::X64_ARCHITECTURE)
|
||||
architecture_token = "; Win64; x64";
|
||||
else if (windows_architecture == base::win::OSInfo::IA64_ARCHITECTURE)
|
||||
|
Reference in New Issue
Block a user