summaryrefslogtreecommitdiffstats
path: root/chrome/browser/memory_details_win.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:15:34 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:15:34 +0000
commitf4812211951630ac47b96a1b7b78f3a3dcc2b9b9 (patch)
tree68db135c222a25e8a158bdff620624aa1d75ec34 /chrome/browser/memory_details_win.cc
parent42e5c865f8702de0cd9e24726fe9bf69cb5cae9c (diff)
downloadchromium_src-f4812211951630ac47b96a1b7b78f3a3dcc2b9b9.zip
chromium_src-f4812211951630ac47b96a1b7b78f3a3dcc2b9b9.tar.gz
chromium_src-f4812211951630ac47b96a1b7b78f3a3dcc2b9b9.tar.bz2
Make the windows_version.h functions threadsafe by using a singleton. Add accessors to the singleton for more values that various code wants, then convert almost everyone using OSVERSIONINFO or SYSTEM_INFO structs to calling these accessors. Declare an AtExitManager in the out-of-process test runner since it didn't have one and that breaks singleton-using code in the test executable (as opposed to in chrome.dll).
A few other minor cleanups along the way (binding of "*", shorter code, etc.). Because I ran into problems with it while modifying gcapi.cc, I cleaned up our usage of strsafe.h a bit, so that files that don't need it don't include it and files that do use STRSAFE_NO_DEPRECATE instead of a modified #include order. BUG=none TEST=none Review URL: http://codereview.chromium.org/6816027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/memory_details_win.cc')
-rw-r--r--chrome/browser/memory_details_win.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc
index c954a8e..576c74c 100644
--- a/chrome/browser/memory_details_win.cc
+++ b/chrome/browser/memory_details_win.cc
@@ -72,8 +72,8 @@ void MemoryDetails::CollectProcessData(
for (unsigned int index = 0; index < process_data_.size(); index++)
process_data_[index].processes.clear();
- base::win::WindowsArchitecture windows_architecture =
- base::win::GetWindowsArchitecture();
+ base::win::OSInfo::WindowsArchitecture windows_architecture =
+ base::win::OSInfo::GetInstance()->architecture();
base::win::ScopedHandle snapshot(
::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
@@ -93,10 +93,10 @@ void MemoryDetails::CollectProcessData(
if (!process_handle.Get())
continue;
bool is_64bit_process =
- ((windows_architecture == base::win::X64_ARCHITECTURE) ||
- (windows_architecture == base::win::IA64_ARCHITECTURE)) &&
- (base::win::GetWOW64StatusForProcess(process_handle) ==
- base::win::WOW64_DISABLED);
+ ((windows_architecture == base::win::OSInfo::X64_ARCHITECTURE) ||
+ (windows_architecture == base::win::OSInfo::IA64_ARCHITECTURE)) &&
+ (base::win::OSInfo::GetWOW64StatusForProcess(process_handle) ==
+ base::win::OSInfo::WOW64_DISABLED);
for (unsigned int index2 = 0; index2 < process_data_.size(); index2++) {
if (_wcsicmp(process_data_[index2].process_name.c_str(),
process_entry.szExeFile) != 0)