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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Check if this is one of the child processes whose data was already | 50 // Check if this is one of the child processes whose data was already |
51 // collected and exists in |child_data|. | 51 // collected and exists in |child_data|. |
52 for (const ProcessMemoryInformation& child : child_info) { | 52 for (const ProcessMemoryInformation& child : child_info) { |
53 if (child.pid == info.pid) { | 53 if (child.pid == info.pid) { |
54 info.titles = child.titles; | 54 info.titles = child.titles; |
55 info.process_type = child.process_type; | 55 info.process_type = child.process_type; |
56 break; | 56 break; |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 std::unique_ptr<base::ProcessMetrics> metrics; | 60 std::unique_ptr<base::ProcessMetrics> metrics = |
61 metrics.reset(base::ProcessMetrics::CreateProcessMetrics( | 61 base::ProcessMetrics::CreateProcessMetrics( |
62 pid, content::BrowserChildProcessHost::GetPortProvider())); | 62 pid, content::BrowserChildProcessHost::GetPortProvider()); |
63 metrics->GetCommittedAndWorkingSetKBytes(&info.committed, &info.working_set); | 63 metrics->GetCommittedAndWorkingSetKBytes(&info.committed, &info.working_set); |
64 | 64 |
65 processes->push_back(info); | 65 processes->push_back(info); |
66 } | 66 } |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 MemoryDetails::MemoryDetails() { | 70 MemoryDetails::MemoryDetails() { |
71 const base::FilePath browser_process_path = | 71 const base::FilePath browser_process_path = |
72 base::GetProcessExecutablePath(base::GetCurrentProcessHandle()); | 72 base::GetProcessExecutablePath(base::GetCurrentProcessHandle()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 // Collect data about Chrome/Chromium. | 124 // Collect data about Chrome/Chromium. |
125 for (const base::ProcessId& pid : all_pids) | 125 for (const base::ProcessId& pid : all_pids) |
126 CollectProcessDataForChromeProcess(child_info, pid, chrome_processes); | 126 CollectProcessDataForChromeProcess(child_info, pid, chrome_processes); |
127 | 127 |
128 // Finally return to the browser thread. | 128 // Finally return to the browser thread. |
129 BrowserThread::PostTask( | 129 BrowserThread::PostTask( |
130 BrowserThread::UI, FROM_HERE, | 130 BrowserThread::UI, FROM_HERE, |
131 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); | 131 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); |
132 } | 132 } |
OLD | NEW |