| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 6 |
| 7 #include <psapi.h> | 7 #include <psapi.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 CHROME_NACL_PROCESS, | 28 CHROME_NACL_PROCESS, |
| 29 IE_BROWSER, | 29 IE_BROWSER, |
| 30 FIREFOX_BROWSER, | 30 FIREFOX_BROWSER, |
| 31 OPERA_BROWSER, | 31 OPERA_BROWSER, |
| 32 SAFARI_BROWSER, | 32 SAFARI_BROWSER, |
| 33 IE_64BIT_BROWSER, | 33 IE_64BIT_BROWSER, |
| 34 KONQUEROR_BROWSER, | 34 KONQUEROR_BROWSER, |
| 35 MAX_BROWSERS | 35 MAX_BROWSERS |
| 36 } BrowserProcess; | 36 } BrowserProcess; |
| 37 | 37 |
| 38 MemoryDetails::MemoryDetails() { | 38 MemoryDetails::MemoryDetails() |
| 39 : user_metrics_mode_(UPDATE_USER_METRICS) { |
| 39 static const std::wstring google_browser_name = | 40 static const std::wstring google_browser_name = |
| 40 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 41 UTF16ToWide(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 41 struct { | 42 struct { |
| 42 const wchar_t* name; | 43 const wchar_t* name; |
| 43 const wchar_t* process_name; | 44 const wchar_t* process_name; |
| 44 } process_template[MAX_BROWSERS] = { | 45 } process_template[MAX_BROWSERS] = { |
| 45 { google_browser_name.c_str(), L"chrome.exe", }, | 46 { google_browser_name.c_str(), L"chrome.exe", }, |
| 46 { google_browser_name.c_str(), L"nacl64.exe", }, | 47 { google_browser_name.c_str(), L"nacl64.exe", }, |
| 47 { L"IE", L"iexplore.exe", }, | 48 { L"IE", L"iexplore.exe", }, |
| 48 { L"Firefox", L"firefox.exe", }, | 49 { L"Firefox", L"firefox.exe", }, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 152 } |
| 152 break; | 153 break; |
| 153 } | 154 } |
| 154 } while (::Process32Next(snapshot, &process_entry)); | 155 } while (::Process32Next(snapshot, &process_entry)); |
| 155 | 156 |
| 156 // Finally return to the browser thread. | 157 // Finally return to the browser thread. |
| 157 BrowserThread::PostTask( | 158 BrowserThread::PostTask( |
| 158 BrowserThread::UI, FROM_HERE, | 159 BrowserThread::UI, FROM_HERE, |
| 159 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); | 160 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); |
| 160 } | 161 } |
| OLD | NEW |