OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <sys/types.h> | 7 #include <sys/types.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 process_map.find(current_process.parent); | 185 process_map.find(current_process.parent); |
186 if (parent_iter == process_map.end()) { | 186 if (parent_iter == process_map.end()) { |
187 browsers_found.insert(current_process.pid); | 187 browsers_found.insert(current_process.pid); |
188 continue; | 188 continue; |
189 } | 189 } |
190 | 190 |
191 if (GetBrowserType(parent_iter->second.name) != type) { | 191 if (GetBrowserType(parent_iter->second.name) != type) { |
192 // We found a process whose type is diffent from its parent's type. | 192 // We found a process whose type is diffent from its parent's type. |
193 // That means it is the root process of the browser. | 193 // That means it is the root process of the browser. |
194 browsers_found.insert(current_process.pid); | 194 browsers_found.insert(current_process.pid); |
195 break; | 195 continue; |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 ProcessData current_browser = | 199 ProcessData current_browser = |
200 GetProcessDataMemoryInformation(GetAllChildren(process_map, getpid())); | 200 GetProcessDataMemoryInformation(GetAllChildren(process_map, getpid())); |
201 current_browser.name = l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME); | 201 current_browser.name = l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME); |
202 current_browser.process_name = base::ASCIIToUTF16("chrome"); | 202 current_browser.process_name = base::ASCIIToUTF16("chrome"); |
203 | 203 |
204 for (std::vector<ProcessMemoryInformation>::iterator | 204 for (std::vector<ProcessMemoryInformation>::iterator |
205 i = current_browser.processes.begin(); | 205 i = current_browser.processes.begin(); |
(...skipping 30 matching lines...) Expand all Loading... |
236 | 236 |
237 #if defined(OS_CHROMEOS) | 237 #if defined(OS_CHROMEOS) |
238 base::GetSwapInfo(&swap_info_); | 238 base::GetSwapInfo(&swap_info_); |
239 #endif | 239 #endif |
240 | 240 |
241 // Finally return to the browser thread. | 241 // Finally return to the browser thread. |
242 BrowserThread::PostTask( | 242 BrowserThread::PostTask( |
243 BrowserThread::UI, FROM_HERE, | 243 BrowserThread::UI, FROM_HERE, |
244 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); | 244 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); |
245 } | 245 } |
OLD | NEW |