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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 next_wavefront.insert(i->pid); | 193 next_wavefront.insert(i->pid); |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
197 wavefront.clear(); | 197 wavefront.clear(); |
198 wavefront.swap(next_wavefront); | 198 wavefront.swap(next_wavefront); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 void MemoryDetails::CollectProcessData( | 202 void MemoryDetails::CollectProcessData( |
203 std::vector<ProcessMemoryInformation> child_info) { | 203 const std::vector<ProcessMemoryInformation>& child_info) { |
204 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 204 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
205 | 205 |
206 std::vector<Process> processes; | 206 std::vector<Process> processes; |
207 GetProcesses(&processes); | 207 GetProcesses(&processes); |
208 std::set<pid_t> browsers_found; | 208 std::set<pid_t> browsers_found; |
209 | 209 |
210 // For each process on the system, if it appears to be a browser process and | 210 // For each process on the system, if it appears to be a browser process and |
211 // it's parent isn't a browser process, then record it in |browsers_found|. | 211 // it's parent isn't a browser process, then record it in |browsers_found|. |
212 for (std::vector<Process>::const_iterator | 212 for (std::vector<Process>::const_iterator |
213 i = processes.begin(); i != processes.end(); ++i) { | 213 i = processes.begin(); i != processes.end(); ++i) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 | 265 |
266 process_data_.push_back(browser); | 266 process_data_.push_back(browser); |
267 } | 267 } |
268 | 268 |
269 // Finally return to the browser thread. | 269 // Finally return to the browser thread. |
270 BrowserThread::PostTask( | 270 BrowserThread::PostTask( |
271 BrowserThread::UI, FROM_HERE, | 271 BrowserThread::UI, FROM_HERE, |
272 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); | 272 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); |
273 } | 273 } |
OLD | NEW |