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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 wavefront.clear(); | 183 wavefront.clear(); |
184 wavefront.swap(next_wavefront); | 184 wavefront.swap(next_wavefront); |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 void MemoryDetails::CollectProcessData( | 188 void MemoryDetails::CollectProcessData( |
189 std::vector<ProcessMemoryInformation> child_info) { | 189 std::vector<ProcessMemoryInformation> child_info) { |
190 DCHECK(MessageLoop::current() == | 190 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); |
191 ChromeThread::GetMessageLoop(ChromeThread::FILE)); | |
192 | 191 |
193 std::vector<Process> processes; | 192 std::vector<Process> processes; |
194 GetProcesses(&processes); | 193 GetProcesses(&processes); |
195 std::set<pid_t> browsers_found; | 194 std::set<pid_t> browsers_found; |
196 | 195 |
197 // For each process on the system, if it appears to be a browser process and | 196 // For each process on the system, if it appears to be a browser process and |
198 // it's parent isn't a browser process, then record it in |browsers_found|. | 197 // it's parent isn't a browser process, then record it in |browsers_found|. |
199 for (std::vector<Process>::const_iterator | 198 for (std::vector<Process>::const_iterator |
200 i = processes.begin(); i != processes.end(); ++i) { | 199 i = processes.begin(); i != processes.end(); ++i) { |
201 const BrowserType type = GetBrowserType(i->name); | 200 const BrowserType type = GetBrowserType(i->name); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 248 } |
250 } | 249 } |
251 | 250 |
252 process_data_.push_back(browser); | 251 process_data_.push_back(browser); |
253 } | 252 } |
254 | 253 |
255 // Finally return to the browser thread. | 254 // Finally return to the browser thread. |
256 ui_loop_->PostTask(FROM_HERE, | 255 ui_loop_->PostTask(FROM_HERE, |
257 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); | 256 NewRunnableMethod(this, &MemoryDetails::CollectChildInfoOnUIThread)); |
258 } | 257 } |
OLD | NEW |