| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 info.titles = child.titles; | 55 info.titles = child.titles; |
| 56 info.process_type = child.process_type; | 56 info.process_type = child.process_type; |
| 57 break; | 57 break; |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 std::unique_ptr<base::ProcessMetrics> metrics = | 61 std::unique_ptr<base::ProcessMetrics> metrics = |
| 62 base::ProcessMetrics::CreateProcessMetrics( | 62 base::ProcessMetrics::CreateProcessMetrics( |
| 63 pid, content::BrowserChildProcessHost::GetPortProvider()); | 63 pid, content::BrowserChildProcessHost::GetPortProvider()); |
| 64 metrics->GetCommittedAndWorkingSetKBytes(&info.committed, &info.working_set); | 64 metrics->GetCommittedAndWorkingSetKBytes(&info.committed, &info.working_set); |
| 65 info.phys_footprint = metrics->GetPhysicalFootprint(); |
| 65 | 66 |
| 66 processes->push_back(info); | 67 processes->push_back(info); |
| 67 } | 68 } |
| 68 | 69 |
| 69 } // namespace | 70 } // namespace |
| 70 | 71 |
| 71 MemoryDetails::MemoryDetails() { | 72 MemoryDetails::MemoryDetails() { |
| 72 const base::FilePath browser_process_path = | 73 const base::FilePath browser_process_path = |
| 73 base::GetProcessExecutablePath(base::GetCurrentProcessHandle()); | 74 base::GetProcessExecutablePath(base::GetCurrentProcessHandle()); |
| 74 | 75 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 125 |
| 125 // Collect data about Chrome/Chromium. | 126 // Collect data about Chrome/Chromium. |
| 126 for (const base::ProcessId& pid : all_pids) | 127 for (const base::ProcessId& pid : all_pids) |
| 127 CollectProcessDataForChromeProcess(child_info, pid, chrome_processes); | 128 CollectProcessDataForChromeProcess(child_info, pid, chrome_processes); |
| 128 | 129 |
| 129 // Finally return to the browser thread. | 130 // Finally return to the browser thread. |
| 130 BrowserThread::PostTask( | 131 BrowserThread::PostTask( |
| 131 BrowserThread::UI, FROM_HERE, | 132 BrowserThread::UI, FROM_HERE, |
| 132 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); | 133 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); |
| 133 } | 134 } |
| OLD | NEW |