| 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 "components/memory_pressure/memory_pressure_stats_collector.h" | 5 #include "components/memory_pressure/memory_pressure_stats_collector.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 7 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 8 #include "base/time/tick_clock.h" | 12 #include "base/time/tick_clock.h" |
| 9 | 13 |
| 10 namespace memory_pressure { | 14 namespace memory_pressure { |
| 11 | 15 |
| 12 namespace { | 16 namespace { |
| 13 | 17 |
| 14 using MemoryPressureLevel = MemoryPressureListener::MemoryPressureLevel; | 18 using MemoryPressureLevel = MemoryPressureListener::MemoryPressureLevel; |
| 15 | 19 |
| 16 // Converts a memory pressure level to an UMA enumeration value. | 20 // Converts a memory pressure level to an UMA enumeration value. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 void MemoryPressureStatsCollector::ReportLevelChange( | 149 void MemoryPressureStatsCollector::ReportLevelChange( |
| 146 MemoryPressureLevel old_pressure_level, | 150 MemoryPressureLevel old_pressure_level, |
| 147 MemoryPressureLevel new_pressure_level) { | 151 MemoryPressureLevel new_pressure_level) { |
| 148 UMA_HISTOGRAM_ENUMERATION("Memory.PressureLevelChange", | 152 UMA_HISTOGRAM_ENUMERATION("Memory.PressureLevelChange", |
| 149 MemoryPressureLevelChangeToUmaEnumValue( | 153 MemoryPressureLevelChangeToUmaEnumValue( |
| 150 old_pressure_level, new_pressure_level), | 154 old_pressure_level, new_pressure_level), |
| 151 UMA_MEMORY_PRESSURE_LEVEL_CHANGE_COUNT); | 155 UMA_MEMORY_PRESSURE_LEVEL_CHANGE_COUNT); |
| 152 } | 156 } |
| 153 | 157 |
| 154 } // namespace memory_pressure | 158 } // namespace memory_pressure |
| OLD | NEW |