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

Side by Side Diff: base/process/process_metrics_mac.cc

Issue 2847593002: [Merge to 3071] Stop emitting physical footprint on macOS 10.11. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_memory_details.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "base/process/process_metrics.h" 5 #include "base/process/process_metrics.h"
6 6
7 #include <mach/mach.h> 7 #include <mach/mach.h>
8 #include <mach/mach_vm.h> 8 #include <mach/mach_vm.h>
9 #include <mach/shared_region.h> 9 #include <mach/shared_region.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 usage->image = 0; 282 usage->image = 0;
283 283
284 ws_usage->priv = task_info_data.resident_size / 1024; 284 ws_usage->priv = task_info_data.resident_size / 1024;
285 ws_usage->shareable = 0; 285 ws_usage->shareable = 0;
286 ws_usage->shared = 0; 286 ws_usage->shared = 0;
287 287
288 return true; 288 return true;
289 } 289 }
290 290
291 size_t ProcessMetrics::GetPhysicalFootprint() const { 291 size_t ProcessMetrics::GetPhysicalFootprint() const {
292 if (mac::IsAtMostOS10_10()) 292 if (mac::IsAtMostOS10_11())
293 return 0; 293 return 0;
294 294
295 ChromeTaskVMInfo task_vm_info; 295 ChromeTaskVMInfo task_vm_info;
296 mach_msg_type_number_t count = ChromeTaskVMInfoCount; 296 mach_msg_type_number_t count = ChromeTaskVMInfoCount;
297 kern_return_t result = 297 kern_return_t result =
298 task_info(TaskForPid(process_), TASK_VM_INFO, 298 task_info(TaskForPid(process_), TASK_VM_INFO,
299 reinterpret_cast<task_info_t>(&task_vm_info), &count); 299 reinterpret_cast<task_info_t>(&task_vm_info), &count);
300 if (result != KERN_SUCCESS) 300 if (result != KERN_SUCCESS)
301 return 0; 301 return 0;
302 return task_vm_info.phys_footprint; 302 return task_vm_info.phys_footprint;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 task, address, size, VM_REGION_BASIC_INFO_64, 496 task, address, size, VM_REGION_BASIC_INFO_64,
497 reinterpret_cast<vm_region_info_t>(info), &info_count, &object_name); 497 reinterpret_cast<vm_region_info_t>(info), &info_count, &object_name);
498 // The kernel always returns a null object for VM_REGION_BASIC_INFO_64, but 498 // The kernel always returns a null object for VM_REGION_BASIC_INFO_64, but
499 // balance it with a deallocate in case this ever changes. See 10.9.2 499 // balance it with a deallocate in case this ever changes. See 10.9.2
500 // xnu-2422.90.20/osfmk/vm/vm_map.c vm_map_region. 500 // xnu-2422.90.20/osfmk/vm/vm_map.c vm_map_region.
501 mach_port_deallocate(task, object_name); 501 mach_port_deallocate(task, object_name);
502 return ParseOutputFromMachVMRegion(kr); 502 return ParseOutputFromMachVMRegion(kr);
503 } 503 }
504 504
505 } // namespace base 505 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_memory_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698