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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return content::GetProcessTypeNameInEnglish(process_type); | 90 return content::GetProcessTypeNameInEnglish(process_type); |
91 } | 91 } |
92 | 92 |
93 ProcessMemoryInformation::ProcessMemoryInformation() | 93 ProcessMemoryInformation::ProcessMemoryInformation() |
94 : pid(0), | 94 : pid(0), |
95 num_processes(0), | 95 num_processes(0), |
96 process_type(content::PROCESS_TYPE_UNKNOWN), | 96 process_type(content::PROCESS_TYPE_UNKNOWN), |
97 num_open_fds(-1), | 97 num_open_fds(-1), |
98 open_fds_soft_limit(-1), | 98 open_fds_soft_limit(-1), |
99 renderer_type(RENDERER_UNKNOWN), | 99 renderer_type(RENDERER_UNKNOWN), |
100 phys_footprint(0) {} | 100 phys_footprint(0), |
| 101 private_memory_footprint(0) {} |
101 | 102 |
102 ProcessMemoryInformation::ProcessMemoryInformation( | 103 ProcessMemoryInformation::ProcessMemoryInformation( |
103 const ProcessMemoryInformation& other) = default; | 104 const ProcessMemoryInformation& other) = default; |
104 | 105 |
105 ProcessMemoryInformation::~ProcessMemoryInformation() {} | 106 ProcessMemoryInformation::~ProcessMemoryInformation() {} |
106 | 107 |
107 bool ProcessMemoryInformation::operator<( | 108 bool ProcessMemoryInformation::operator<( |
108 const ProcessMemoryInformation& rhs) const { | 109 const ProcessMemoryInformation& rhs) const { |
109 return working_set.priv < rhs.working_set.priv; | 110 return working_set.priv < rhs.working_set.priv; |
110 } | 111 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // Get rid of other Chrome processes that are from a different profile. | 356 // Get rid of other Chrome processes that are from a different profile. |
356 auto is_unknown = [](ProcessMemoryInformation& process) { | 357 auto is_unknown = [](ProcessMemoryInformation& process) { |
357 return process.process_type == content::PROCESS_TYPE_UNKNOWN; | 358 return process.process_type == content::PROCESS_TYPE_UNKNOWN; |
358 }; | 359 }; |
359 auto& vector = chrome_browser->processes; | 360 auto& vector = chrome_browser->processes; |
360 vector.erase(std::remove_if(vector.begin(), vector.end(), is_unknown), | 361 vector.erase(std::remove_if(vector.begin(), vector.end(), is_unknown), |
361 vector.end()); | 362 vector.end()); |
362 | 363 |
363 OnDetailsAvailable(); | 364 OnDetailsAvailable(); |
364 } | 365 } |
OLD | NEW |