| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 void PrintIOPerfInfo(const char* test_name) { | 142 void PrintIOPerfInfo(const char* test_name) { |
| 143 FilePath data_dir; | 143 FilePath data_dir; |
| 144 PathService::Get(chrome::DIR_USER_DATA, &data_dir); | 144 PathService::Get(chrome::DIR_USER_DATA, &data_dir); |
| 145 int browser_process_pid = ChromeBrowserProcessId(data_dir); | 145 int browser_process_pid = ChromeBrowserProcessId(data_dir); |
| 146 ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir)); | 146 ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir)); |
| 147 | 147 |
| 148 ChromeProcessList::const_iterator it; | 148 ChromeProcessList::const_iterator it; |
| 149 for (it = chrome_processes.begin(); it != chrome_processes.end(); ++it) { | 149 for (it = chrome_processes.begin(); it != chrome_processes.end(); ++it) { |
| 150 base::ProcessHandle process_handle; | 150 base::ProcessHandle process_handle; |
| 151 if (!base::OpenProcessHandle(*it, &process_handle)) { | 151 if (!base::OpenPrivilegedProcessHandle(*it, &process_handle)) { |
| 152 NOTREACHED(); | 152 NOTREACHED(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 scoped_ptr<base::ProcessMetrics> process_metrics; | 155 scoped_ptr<base::ProcessMetrics> process_metrics; |
| 156 process_metrics.reset( | 156 process_metrics.reset( |
| 157 base::ProcessMetrics::CreateProcessMetrics(process_handle)); | 157 base::ProcessMetrics::CreateProcessMetrics(process_handle)); |
| 158 IoCounters io_counters; | 158 IoCounters io_counters; |
| 159 memset(&io_counters, 0, sizeof(io_counters)); | 159 memset(&io_counters, 0, sizeof(io_counters)); |
| 160 | 160 |
| 161 if (process_metrics.get()->GetIOCounters(&io_counters)) { | 161 if (process_metrics.get()->GetIOCounters(&io_counters)) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 void PrintMemoryUsageInfo(const char* test_name) { | 211 void PrintMemoryUsageInfo(const char* test_name) { |
| 212 FilePath data_dir; | 212 FilePath data_dir; |
| 213 PathService::Get(chrome::DIR_USER_DATA, &data_dir); | 213 PathService::Get(chrome::DIR_USER_DATA, &data_dir); |
| 214 int browser_process_pid = ChromeBrowserProcessId(data_dir); | 214 int browser_process_pid = ChromeBrowserProcessId(data_dir); |
| 215 ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir)); | 215 ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir)); |
| 216 | 216 |
| 217 #if !defined(OS_MACOSX) | 217 #if !defined(OS_MACOSX) |
| 218 ChromeProcessList::const_iterator it; | 218 ChromeProcessList::const_iterator it; |
| 219 for (it = chrome_processes.begin(); it != chrome_processes.end(); ++it) { | 219 for (it = chrome_processes.begin(); it != chrome_processes.end(); ++it) { |
| 220 base::ProcessHandle process_handle; | 220 base::ProcessHandle process_handle; |
| 221 if (!base::OpenProcessHandle(*it, &process_handle)) { | 221 if (!base::OpenPrivilegedProcessHandle(*it, &process_handle)) { |
| 222 NOTREACHED(); | 222 NOTREACHED(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 scoped_ptr<base::ProcessMetrics> process_metrics; | 225 scoped_ptr<base::ProcessMetrics> process_metrics; |
| 226 process_metrics.reset( | 226 process_metrics.reset( |
| 227 base::ProcessMetrics::CreateProcessMetrics(process_handle)); | 227 base::ProcessMetrics::CreateProcessMetrics(process_handle)); |
| 228 | 228 |
| 229 std::string chrome_name = (*it == browser_process_pid) ? "_b" : "_r"; | 229 std::string chrome_name = (*it == browser_process_pid) ? "_b" : "_r"; |
| 230 | 230 |
| 231 std::string trace_name(test_name); | 231 std::string trace_name(test_name); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 426 |
| 427 TEST_F(PageCyclerTest, BloatHttp) { | 427 TEST_F(PageCyclerTest, BloatHttp) { |
| 428 RunTest("bloat", true); | 428 RunTest("bloat", true); |
| 429 } | 429 } |
| 430 | 430 |
| 431 TEST_F(PageCyclerReferenceTest, BloatHttp) { | 431 TEST_F(PageCyclerReferenceTest, BloatHttp) { |
| 432 RunTest("bloat", true); | 432 RunTest("bloat", true); |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace | 435 } // namespace |
| OLD | NEW |