Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: chrome/browser/memory_details_win.cc

Issue 1689012: Move common code into process_util.cc (Closed)
Patch Set: More fixes Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/memory_details_mac.cc ('k') | chrome/browser/process_singleton_win_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/memory_details.h" 5 #include "chrome/browser/memory_details.h"
6 #include <psapi.h> 6 #include <psapi.h>
7 7
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // IsWow64Process() returns FALSE for a 32bit process on a 32bit OS. 94 // IsWow64Process() returns FALSE for a 32bit process on a 32bit OS.
95 // We need to check if the real OS is 64bit. 95 // We need to check if the real OS is 64bit.
96 if (is_64bit_os) { 96 if (is_64bit_os) {
97 BOOL is_wow64 = FALSE; 97 BOOL is_wow64 = FALSE;
98 // IsWow64Process() is supported by Windows XP SP2 or later. 98 // IsWow64Process() is supported by Windows XP SP2 or later.
99 IsWow64Process(handle, &is_wow64); 99 IsWow64Process(handle, &is_wow64);
100 is_64bit_process = !is_wow64; 100 is_64bit_process = !is_wow64;
101 } 101 }
102 for (int index2 = 0; index2 < arraysize(g_process_template); index2++) { 102 for (int index2 = 0; index2 < arraysize(g_process_template); index2++) {
103 if (_wcsicmp(process_data_[index2].process_name.c_str(), 103 if (_wcsicmp(process_data_[index2].process_name.c_str(),
104 process_entry.szExeFile) != 0) 104 process_entry.szExeFile) != 0)
105 continue; 105 continue;
106 if (index2 == IE_BROWSER && is_64bit_process) 106 if (index2 == IE_BROWSER && is_64bit_process)
107 continue; // Should use IE_64BIT_BROWSER 107 continue; // Should use IE_64BIT_BROWSER
108 // Get Memory Information. 108 // Get Memory Information.
109 ProcessMemoryInformation info; 109 ProcessMemoryInformation info;
110 info.pid = pid; 110 info.pid = pid;
111 if (info.pid == GetCurrentProcessId()) 111 if (info.pid == GetCurrentProcessId())
112 info.type = ChildProcessInfo::BROWSER_PROCESS; 112 info.type = ChildProcessInfo::BROWSER_PROCESS;
113 else 113 else
114 info.type = ChildProcessInfo::UNKNOWN_PROCESS; 114 info.type = ChildProcessInfo::UNKNOWN_PROCESS;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 break; 154 break;
155 } 155 }
156 } while (::Process32Next(snapshot, &process_entry)); 156 } while (::Process32Next(snapshot, &process_entry));
157 157
158 // Finally return to the browser thread. 158 // Finally return to the browser thread.
159 ChromeThread::PostTask( 159 ChromeThread::PostTask(
160 ChromeThread::UI, FROM_HERE, 160 ChromeThread::UI, FROM_HERE,
161 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); 161 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread));
162 } 162 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details_mac.cc ('k') | chrome/browser/process_singleton_win_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698