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

Side by Side Diff: base/memory/memory_pressure_monitor_win.h

Issue 2495003004: [Mac] Report statistics more regularly in Mac memory pressure monitor (Closed)
Patch Set: Report in 5 second ticks Created 4 years, 1 month 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 | « base/memory/memory_pressure_monitor_mac.cc ('k') | base/memory/memory_pressure_monitor_win.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 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 #ifndef BASE_MEMORY_MEMORY_PRESSURE_MONITOR_WIN_H_ 5 #ifndef BASE_MEMORY_MEMORY_PRESSURE_MONITOR_WIN_H_
6 #define BASE_MEMORY_MEMORY_PRESSURE_MONITOR_WIN_H_ 6 #define BASE_MEMORY_MEMORY_PRESSURE_MONITOR_WIN_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/memory_pressure_listener.h" 10 #include "base/memory/memory_pressure_listener.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // free memory below which the applicable memory pressure state engages. 55 // free memory below which the applicable memory pressure state engages.
56 MemoryPressureMonitor(int moderate_threshold_mb, int critical_threshold_mb); 56 MemoryPressureMonitor(int moderate_threshold_mb, int critical_threshold_mb);
57 57
58 ~MemoryPressureMonitor() override; 58 ~MemoryPressureMonitor() override;
59 59
60 // Schedules a memory pressure check to run soon. This must be called on the 60 // Schedules a memory pressure check to run soon. This must be called on the
61 // same thread where the monitor was instantiated. 61 // same thread where the monitor was instantiated.
62 void CheckMemoryPressureSoon(); 62 void CheckMemoryPressureSoon();
63 63
64 // Get the current memory pressure level. This can be called from any thread. 64 // Get the current memory pressure level. This can be called from any thread.
65 MemoryPressureLevel GetCurrentPressureLevel() const override; 65 MemoryPressureLevel GetCurrentPressureLevel() override;
66 void SetDispatchCallback(const DispatchCallback& callback) override; 66 void SetDispatchCallback(const DispatchCallback& callback) override;
67 67
68 // Returns the moderate pressure level free memory threshold, in MB. 68 // Returns the moderate pressure level free memory threshold, in MB.
69 int moderate_threshold_mb() const { return moderate_threshold_mb_; } 69 int moderate_threshold_mb() const { return moderate_threshold_mb_; }
70 70
71 // Returns the critical pressure level free memory threshold, in MB. 71 // Returns the critical pressure level free memory threshold, in MB.
72 int critical_threshold_mb() const { return critical_threshold_mb_; } 72 int critical_threshold_mb() const { return critical_threshold_mb_; }
73 73
74 protected: 74 protected:
75 // Internals are exposed for unittests. 75 // Internals are exposed for unittests.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // CheckMemoryPressure/CheckMemoryPressureAndRecordStatistics via |timer_|. 139 // CheckMemoryPressure/CheckMemoryPressureAndRecordStatistics via |timer_|.
140 base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_; 140 base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_;
141 141
142 DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor); 142 DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor);
143 }; 143 };
144 144
145 } // namespace win 145 } // namespace win
146 } // namespace base 146 } // namespace base
147 147
148 #endif // BASE_MEMORY_MEMORY_PRESSURE_MONITOR_WIN_H_ 148 #endif // BASE_MEMORY_MEMORY_PRESSURE_MONITOR_WIN_H_
OLDNEW
« no previous file with comments | « base/memory/memory_pressure_monitor_mac.cc ('k') | base/memory/memory_pressure_monitor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698