| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_path.h" |
| 9 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
| 10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/browser_child_process_host.h" | 13 #include "chrome/browser/browser_child_process_host.h" |
| 13 #include "chrome/browser/browser_thread.h" | 14 #include "chrome/browser/browser_thread.h" |
| 14 #include "chrome/browser/renderer_host/backing_store_manager.h" | 15 #include "chrome/browser/renderer_host/backing_store_manager.h" |
| 15 #include "chrome/browser/renderer_host/render_process_host.h" | 16 #include "chrome/browser/renderer_host/render_process_host.h" |
| 16 #include "chrome/browser/tab_contents/navigation_entry.h" | 17 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 17 #include "chrome/common/chrome_version_info.h" | 18 #include "chrome/common/chrome_version_info.h" |
| 18 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 for (size_t child = 0; child < child_info.size(); child++) { | 129 for (size_t child = 0; child < child_info.size(); child++) { |
| 129 if (child_info[child].pid != info.pid) | 130 if (child_info[child].pid != info.pid) |
| 130 continue; | 131 continue; |
| 131 info.titles = child_info[child].titles; | 132 info.titles = child_info[child].titles; |
| 132 info.type = child_info[child].type; | 133 info.type = child_info[child].type; |
| 133 break; | 134 break; |
| 134 } | 135 } |
| 135 } else if (GetModuleFileNameEx(handle, NULL, name, MAX_PATH - 1)) { | 136 } else if (GetModuleFileNameEx(handle, NULL, name, MAX_PATH - 1)) { |
| 136 std::wstring str_name(name); | 137 std::wstring str_name(name); |
| 137 scoped_ptr<FileVersionInfo> version_info( | 138 scoped_ptr<FileVersionInfo> version_info( |
| 138 FileVersionInfo::CreateFileVersionInfo(str_name)); | 139 FileVersionInfo::CreateFileVersionInfo(FilePath(str_name))); |
| 139 if (version_info != NULL) { | 140 if (version_info != NULL) { |
| 140 info.version = version_info->product_version(); | 141 info.version = version_info->product_version(); |
| 141 info.product_name = version_info->product_name(); | 142 info.product_name = version_info->product_name(); |
| 142 } | 143 } |
| 143 } | 144 } |
| 144 | 145 |
| 145 // Add the process info to our list. | 146 // Add the process info to our list. |
| 146 if (index2 == CHROME_NACL_PROCESS) { | 147 if (index2 == CHROME_NACL_PROCESS) { |
| 147 // Add NaCl processes to Chrome's list | 148 // Add NaCl processes to Chrome's list |
| 148 process_data_[CHROME_BROWSER].processes.push_back(info); | 149 process_data_[CHROME_BROWSER].processes.push_back(info); |
| 149 } else { | 150 } else { |
| 150 process_data_[index2].processes.push_back(info); | 151 process_data_[index2].processes.push_back(info); |
| 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 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); | 160 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); |
| 160 } | 161 } |
| OLD | NEW |