| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/system_memory_stats_recorder.h" | 5 #include "components/metrics/system_memory_stats_recorder.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/process/process_metrics.h" | 10 #include "base/process/process_metrics.h" |
| 11 | 11 |
| 12 namespace memory { | 12 namespace metrics { |
| 13 | 13 |
| 14 void RecordMemoryStats(RecordMemoryStatsType type) { | 14 void RecordMemoryStats(RecordMemoryStatsType type) { |
| 15 MEMORYSTATUSEX mem_status; | 15 MEMORYSTATUSEX mem_status; |
| 16 mem_status.dwLength = sizeof(mem_status); | 16 mem_status.dwLength = sizeof(mem_status); |
| 17 if (!::GlobalMemoryStatusEx(&mem_status)) | 17 if (!::GlobalMemoryStatusEx(&mem_status)) |
| 18 return; | 18 return; |
| 19 | 19 |
| 20 switch (type) { | 20 switch (type) { |
| 21 case RECORD_MEMORY_STATS_TAB_DISCARDED: { | 21 case RECORD_MEMORY_STATS_TAB_DISCARDED: { |
| 22 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Stats.Win.MemoryLoad", | 22 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Stats.Win.MemoryLoad", |
| (...skipping 11 matching lines...) Expand all Loading... |
| 34 UMA_HISTOGRAM_LARGE_MEMORY_MB("Memory.Stats.Win.AvailVirtual", | 34 UMA_HISTOGRAM_LARGE_MEMORY_MB("Memory.Stats.Win.AvailVirtual", |
| 35 mem_status.ullAvailVirtual); | 35 mem_status.ullAvailVirtual); |
| 36 break; | 36 break; |
| 37 } | 37 } |
| 38 default: | 38 default: |
| 39 NOTREACHED() << L"Received unexpected notification"; | 39 NOTREACHED() << L"Received unexpected notification"; |
| 40 break; | 40 break; |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace memory | 44 } // namespace metrics |
| OLD | NEW |