| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 ProcessMemoryInformation::ProcessMemoryInformation() | 91 ProcessMemoryInformation::ProcessMemoryInformation() |
| 92 : pid(0), | 92 : pid(0), |
| 93 num_processes(0), | 93 num_processes(0), |
| 94 is_diagnostics(false), | 94 is_diagnostics(false), |
| 95 process_type(content::PROCESS_TYPE_UNKNOWN), | 95 process_type(content::PROCESS_TYPE_UNKNOWN), |
| 96 renderer_type(RENDERER_UNKNOWN) { | 96 renderer_type(RENDERER_UNKNOWN) { |
| 97 } | 97 } |
| 98 | 98 |
| 99 ProcessMemoryInformation::ProcessMemoryInformation( |
| 100 const ProcessMemoryInformation& other) = default; |
| 101 |
| 99 ProcessMemoryInformation::~ProcessMemoryInformation() {} | 102 ProcessMemoryInformation::~ProcessMemoryInformation() {} |
| 100 | 103 |
| 101 bool ProcessMemoryInformation::operator<( | 104 bool ProcessMemoryInformation::operator<( |
| 102 const ProcessMemoryInformation& rhs) const { | 105 const ProcessMemoryInformation& rhs) const { |
| 103 return working_set.priv < rhs.working_set.priv; | 106 return working_set.priv < rhs.working_set.priv; |
| 104 } | 107 } |
| 105 | 108 |
| 106 ProcessData::ProcessData() {} | 109 ProcessData::ProcessData() {} |
| 107 | 110 |
| 108 ProcessData::ProcessData(const ProcessData& rhs) | 111 ProcessData::ProcessData(const ProcessData& rhs) |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 // Get rid of other Chrome processes that are from a different profile. | 375 // Get rid of other Chrome processes that are from a different profile. |
| 373 auto is_unknown = [](ProcessMemoryInformation& process) { | 376 auto is_unknown = [](ProcessMemoryInformation& process) { |
| 374 return process.process_type == content::PROCESS_TYPE_UNKNOWN; | 377 return process.process_type == content::PROCESS_TYPE_UNKNOWN; |
| 375 }; | 378 }; |
| 376 auto& vector = chrome_browser->processes; | 379 auto& vector = chrome_browser->processes; |
| 377 vector.erase(std::remove_if(vector.begin(), vector.end(), is_unknown), | 380 vector.erase(std::remove_if(vector.begin(), vector.end(), is_unknown), |
| 378 vector.end()); | 381 vector.end()); |
| 379 | 382 |
| 380 OnDetailsAvailable(); | 383 OnDetailsAvailable(); |
| 381 } | 384 } |
| OLD | NEW |