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

Side by Side Diff: chrome/test/base/chrome_process_util.cc

Issue 10824033: Coverity: Fix several pass-by-values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win build fix. Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/test/base/chrome_process_util.h" 5 #include "chrome/test/base/chrome_process_util.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 22 matching lines...) Expand all
33 base::KillProcess(handle, content::RESULT_CODE_KILLED, true); 33 base::KillProcess(handle, content::RESULT_CODE_KILLED, true);
34 base::CloseProcessHandle(handle); 34 base::CloseProcessHandle(handle);
35 } 35 }
36 } 36 }
37 37
38 class ChildProcessFilter : public base::ProcessFilter { 38 class ChildProcessFilter : public base::ProcessFilter {
39 public: 39 public:
40 explicit ChildProcessFilter(base::ProcessId parent_pid) 40 explicit ChildProcessFilter(base::ProcessId parent_pid)
41 : parent_pids_(&parent_pid, (&parent_pid) + 1) {} 41 : parent_pids_(&parent_pid, (&parent_pid) + 1) {}
42 42
43 explicit ChildProcessFilter(std::vector<base::ProcessId> parent_pids) 43 explicit ChildProcessFilter(const std::vector<base::ProcessId>& parent_pids)
44 : parent_pids_(parent_pids.begin(), parent_pids.end()) {} 44 : parent_pids_(parent_pids.begin(), parent_pids.end()) {}
45 45
46 virtual bool Includes(const base::ProcessEntry& entry) const { 46 virtual bool Includes(const base::ProcessEntry& entry) const {
47 return parent_pids_.find(entry.parent_pid()) != parent_pids_.end(); 47 return parent_pids_.find(entry.parent_pid()) != parent_pids_.end();
48 } 48 }
49 49
50 private: 50 private:
51 const std::set<base::ProcessId> parent_pids_; 51 const std::set<base::ProcessId> parent_pids_;
52 52
53 DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter); 53 DISALLOW_COPY_AND_ASSIGN(ChildProcessFilter);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 base::ProcessHandle process) { 151 base::ProcessHandle process) {
152 #if !defined(OS_MACOSX) 152 #if !defined(OS_MACOSX)
153 process_metrics_.reset( 153 process_metrics_.reset(
154 base::ProcessMetrics::CreateProcessMetrics(process)); 154 base::ProcessMetrics::CreateProcessMetrics(process));
155 #else 155 #else
156 process_metrics_.reset( 156 process_metrics_.reset(
157 base::ProcessMetrics::CreateProcessMetrics(process, NULL)); 157 base::ProcessMetrics::CreateProcessMetrics(process, NULL));
158 #endif 158 #endif
159 process_handle_ = process; 159 process_handle_ = process;
160 } 160 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/url_pattern.cc ('k') | content/browser/webui/web_ui_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698