| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 FilePath data_dir(user_data_dir()); | 284 FilePath data_dir(user_data_dir()); |
| 285 int browser_process_pid = ChromeBrowserProcessId(data_dir); | 285 int browser_process_pid = ChromeBrowserProcessId(data_dir); |
| 286 ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir)); | 286 ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir)); |
| 287 | 287 |
| 288 ChromeProcessList::const_iterator it; | 288 ChromeProcessList::const_iterator it; |
| 289 for (it = chrome_processes.begin(); it != chrome_processes.end(); ++it) { | 289 for (it = chrome_processes.begin(); it != chrome_processes.end(); ++it) { |
| 290 scoped_ptr<base::ProcessMetrics> process_metrics; | 290 scoped_ptr<base::ProcessMetrics> process_metrics; |
| 291 IoCounters io_counters; | 291 IoCounters io_counters; |
| 292 base::ProcessHandle process_handle; | 292 base::ProcessHandle process_handle; |
| 293 if (!base::OpenProcessHandle(*it, &process_handle)) { | 293 if (!base::OpenPrivilegedProcessHandle(*it, &process_handle)) { |
| 294 NOTREACHED(); | 294 NOTREACHED(); |
| 295 } | 295 } |
| 296 process_metrics.reset( | 296 process_metrics.reset( |
| 297 base::ProcessMetrics::CreateProcessMetrics(process_handle)); | 297 base::ProcessMetrics::CreateProcessMetrics(process_handle)); |
| 298 bzero(&io_counters, sizeof(io_counters)); | 298 bzero(&io_counters, sizeof(io_counters)); |
| 299 | 299 |
| 300 if (process_metrics.get()->GetIOCounters(&io_counters)) { | 300 if (process_metrics.get()->GetIOCounters(&io_counters)) { |
| 301 std::string chrome_name = (*it == browser_process_pid) ? "_b" : "_r"; | 301 std::string chrome_name = (*it == browser_process_pid) ? "_b" : "_r"; |
| 302 | 302 |
| 303 // Print out IO performance. We assume that the values can be | 303 // Print out IO performance. We assume that the values can be |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 TEST_F(MemoryTest, FiveTabTest) { | 448 TEST_F(MemoryTest, FiveTabTest) { |
| 449 RunTest("5t", 5); | 449 RunTest("5t", 5); |
| 450 } | 450 } |
| 451 | 451 |
| 452 TEST_F(MemoryTest, TwelveTabTest) { | 452 TEST_F(MemoryTest, TwelveTabTest) { |
| 453 RunTest("12t", 12); | 453 RunTest("12t", 12); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace | 456 } // namespace |
| OLD | NEW |