| OLD | NEW |
| 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 | 6 |
| 7 #include <unistd.h> | 7 #include <unistd.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <dirent.h> | 9 #include <dirent.h> |
| 10 | 10 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 if (!found_parent) | 231 if (!found_parent) |
| 232 browsers_found.insert(i->pid); | 232 browsers_found.insert(i->pid); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 std::vector<pid_t> current_browser_processes; | 236 std::vector<pid_t> current_browser_processes; |
| 237 const pid_t zygote = Singleton<ZygoteHost>()->pid(); | 237 const pid_t zygote = ZygoteHost::GetInstance()->pid(); |
| 238 GetAllChildren(processes, getpid(), zygote, ¤t_browser_processes); | 238 GetAllChildren(processes, getpid(), zygote, ¤t_browser_processes); |
| 239 ProcessData current_browser; | 239 ProcessData current_browser; |
| 240 GetProcessDataMemoryInformation(current_browser_processes, ¤t_browser); | 240 GetProcessDataMemoryInformation(current_browser_processes, ¤t_browser); |
| 241 current_browser.name = chrome::kBrowserAppName; | 241 current_browser.name = chrome::kBrowserAppName; |
| 242 current_browser.process_name = L"chrome"; | 242 current_browser.process_name = L"chrome"; |
| 243 process_data_.push_back(current_browser); | 243 process_data_.push_back(current_browser); |
| 244 | 244 |
| 245 // For each browser process, collect a list of its children and get the | 245 // For each browser process, collect a list of its children and get the |
| 246 // memory usage of each. | 246 // memory usage of each. |
| 247 for (std::set<pid_t>::const_iterator | 247 for (std::set<pid_t>::const_iterator |
| (...skipping 14 matching lines...) Expand all Loading... |
| 262 } | 262 } |
| 263 | 263 |
| 264 process_data_.push_back(browser); | 264 process_data_.push_back(browser); |
| 265 } | 265 } |
| 266 | 266 |
| 267 // Finally return to the browser thread. | 267 // Finally return to the browser thread. |
| 268 BrowserThread::PostTask( | 268 BrowserThread::PostTask( |
| 269 BrowserThread::UI, FROM_HERE, | 269 BrowserThread::UI, FROM_HERE, |
| 270 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); | 270 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); |
| 271 } | 271 } |
| OLD | NEW |