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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 void GetProcessDataMemoryInformation( | 47 void GetProcessDataMemoryInformation( |
48 const std::set<ProcessId>& pids, ProcessData* out) { | 48 const std::set<ProcessId>& pids, ProcessData* out) { |
49 for (std::set<ProcessId>::const_iterator i = pids.begin(); i != pids.end(); | 49 for (std::set<ProcessId>::const_iterator i = pids.begin(); i != pids.end(); |
50 ++i) { | 50 ++i) { |
51 ProcessMemoryInformation pmi; | 51 ProcessMemoryInformation pmi; |
52 | 52 |
53 pmi.pid = *i; | 53 pmi.pid = *i; |
54 pmi.num_processes = 1; | 54 pmi.num_processes = 1; |
55 | 55 |
56 if (pmi.pid == base::GetCurrentProcId()) | 56 if (pmi.pid == base::GetCurrentProcId()) |
57 pmi.type = content::PROCESS_TYPE_BROWSER; | 57 pmi.process_type = content::PROCESS_TYPE_BROWSER; |
58 else | 58 else |
59 pmi.type = content::PROCESS_TYPE_UNKNOWN; | 59 pmi.process_type = content::PROCESS_TYPE_UNKNOWN; |
60 | 60 |
61 scoped_ptr<base::ProcessMetrics> metrics( | 61 scoped_ptr<base::ProcessMetrics> metrics( |
62 base::ProcessMetrics::CreateProcessMetrics(*i)); | 62 base::ProcessMetrics::CreateProcessMetrics(*i)); |
63 metrics->GetWorkingSetKBytes(&pmi.working_set); | 63 metrics->GetWorkingSetKBytes(&pmi.working_set); |
64 | 64 |
65 out->processes.push_back(pmi); | 65 out->processes.push_back(pmi); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 // Find all children of the given process. | 69 // Find all children of the given process. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 current_browser.name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 131 current_browser.name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
132 current_browser.process_name = | 132 current_browser.process_name = |
133 reinterpret_cast<unsigned int>(chrome::kBrowserProcessExecutableName); | 133 reinterpret_cast<unsigned int>(chrome::kBrowserProcessExecutableName); |
134 process_data_.push_back(current_browser); | 134 process_data_.push_back(current_browser); |
135 | 135 |
136 // Finally return to the browser thread. | 136 // Finally return to the browser thread. |
137 BrowserThread::PostTask( | 137 BrowserThread::PostTask( |
138 BrowserThread::UI, FROM_HERE, | 138 BrowserThread::UI, FROM_HERE, |
139 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); | 139 base::Bind(&MemoryDetails::CollectChildInfoOnUIThread, this)); |
140 } | 140 } |
OLD | NEW |