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

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

Issue 6676015: Coverity: Pass values by reference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win/Mac fix. Created 9 years, 9 months 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
« no previous file with comments | « chrome/browser/memory_details.h ('k') | chrome/browser/memory_details_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details.h ('k') | chrome/browser/memory_details_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698