| Index: chrome/browser/memory_details_win.cc
|
| ===================================================================
|
| --- chrome/browser/memory_details_win.cc (revision 76817)
|
| +++ chrome/browser/memory_details_win.cc (working copy)
|
| @@ -11,6 +11,7 @@
|
| #include "base/string_util.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "base/win/scoped_handle.h"
|
| +#include "base/win/windows_version.h"
|
| #include "chrome/common/chrome_version_info.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "content/browser/browser_child_process_host.h"
|
| @@ -89,19 +90,13 @@
|
| }
|
| do {
|
| base::ProcessId pid = process_entry.th32ProcessID;
|
| - base::win::ScopedHandle handle(::OpenProcess(
|
| + base::win::ScopedHandle process_handle(::OpenProcess(
|
| PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid));
|
| - if (!handle.Get())
|
| + if (!process_handle.Get())
|
| continue;
|
| - bool is_64bit_process = false;
|
| - // IsWow64Process() returns FALSE for a 32bit process on a 32bit OS.
|
| - // We need to check if the real OS is 64bit.
|
| - if (is_64bit_os) {
|
| - BOOL is_wow64 = FALSE;
|
| - // IsWow64Process() is supported by Windows XP SP2 or later.
|
| - IsWow64Process(handle, &is_wow64);
|
| - is_64bit_process = !is_wow64;
|
| - }
|
| + bool is_64bit_process = is_64bit_os &&
|
| + (base::win::GetWOW64StatusForProcess(process_handle) ==
|
| + base::win::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)
|
| @@ -117,7 +112,7 @@
|
| info.type = ChildProcessInfo::UNKNOWN_PROCESS;
|
|
|
| scoped_ptr<base::ProcessMetrics> metrics;
|
| - metrics.reset(base::ProcessMetrics::CreateProcessMetrics(handle));
|
| + metrics.reset(base::ProcessMetrics::CreateProcessMetrics(process_handle));
|
| metrics->GetCommittedKBytes(&info.committed);
|
| metrics->GetWorkingSetKBytes(&info.working_set);
|
|
|
| @@ -136,7 +131,8 @@
|
| info.type = child_info[child].type;
|
| break;
|
| }
|
| - } else if (GetModuleFileNameEx(handle, NULL, name, MAX_PATH - 1)) {
|
| + } else if (GetModuleFileNameEx(process_handle, NULL, name,
|
| + MAX_PATH - 1)) {
|
| std::wstring str_name(name);
|
| scoped_ptr<FileVersionInfo> version_info(
|
| FileVersionInfo::CreateFileVersionInfo(FilePath(str_name)));
|
|
|