Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Side by Side Diff: chrome/browser/memory_details_linux.cc

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698