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

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

Issue 2832933003: Add the UMA metric Memory.Gpu.PhysicalFootprint.MacOS (Closed)
Patch Set: Comments from mark. Created 3 years, 8 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
« no previous file with comments | « chrome/browser/memory_details.h ('k') | chrome/browser/memory_details_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return GetRendererTypeNameInEnglish(rtype); 89 return GetRendererTypeNameInEnglish(rtype);
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 101
101 ProcessMemoryInformation::ProcessMemoryInformation( 102 ProcessMemoryInformation::ProcessMemoryInformation(
102 const ProcessMemoryInformation& other) = default; 103 const ProcessMemoryInformation& other) = default;
103 104
104 ProcessMemoryInformation::~ProcessMemoryInformation() {} 105 ProcessMemoryInformation::~ProcessMemoryInformation() {}
105 106
106 bool ProcessMemoryInformation::operator<( 107 bool ProcessMemoryInformation::operator<(
107 const ProcessMemoryInformation& rhs) const { 108 const ProcessMemoryInformation& rhs) const {
108 return working_set.priv < rhs.working_set.priv; 109 return working_set.priv < rhs.working_set.priv;
109 } 110 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 // Get rid of other Chrome processes that are from a different profile. 354 // Get rid of other Chrome processes that are from a different profile.
354 auto is_unknown = [](ProcessMemoryInformation& process) { 355 auto is_unknown = [](ProcessMemoryInformation& process) {
355 return process.process_type == content::PROCESS_TYPE_UNKNOWN; 356 return process.process_type == content::PROCESS_TYPE_UNKNOWN;
356 }; 357 };
357 auto& vector = chrome_browser->processes; 358 auto& vector = chrome_browser->processes;
358 vector.erase(std::remove_if(vector.begin(), vector.end(), is_unknown), 359 vector.erase(std::remove_if(vector.begin(), vector.end(), is_unknown),
359 vector.end()); 360 vector.end());
360 361
361 OnDetailsAvailable(); 362 OnDetailsAvailable();
362 } 363 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details.h ('k') | chrome/browser/memory_details_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698