Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: chrome/browser/memory_details.cc

Issue 2875823004: Add experimental private memory footprint metrics. (Closed)
Patch Set: compile error. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698