| Index: base/chromeos/memory_pressure_monitor.h
|
| diff --git a/base/chromeos/memory_pressure_monitor_chromeos.h b/base/chromeos/memory_pressure_monitor.h
|
| similarity index 86%
|
| rename from base/chromeos/memory_pressure_monitor_chromeos.h
|
| rename to base/chromeos/memory_pressure_monitor.h
|
| index 45855ebc01a691ae94896952810c14103f72043d..8dec6ef46f95900d52c38dedcb20e63e2dc3be53 100644
|
| --- a/base/chromeos/memory_pressure_monitor_chromeos.h
|
| +++ b/base/chromeos/memory_pressure_monitor.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef BASE_CHROMEOS_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_
|
| -#define BASE_CHROMEOS_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_
|
| +#ifndef BASE_CHROMEOS_MEMORY_PRESSURE_MONITOR_H_
|
| +#define BASE_CHROMEOS_MEMORY_PRESSURE_MONITOR_H_
|
|
|
| #include "base/base_export.h"
|
| #include "base/files/scoped_file.h"
|
| @@ -15,17 +15,18 @@
|
| #include "base/timer/timer.h"
|
|
|
| namespace base {
|
| +namespace chromeos {
|
|
|
| class TestMemoryPressureMonitor;
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// MemoryPressureMonitorChromeOS
|
| +// MemoryPressureMonitor
|
| //
|
| // A class to handle the observation of our free memory. It notifies the
|
| // MemoryPressureListener of memory fill level changes, so that it can take
|
| // action to reduce memory resources accordingly.
|
| //
|
| -class BASE_EXPORT MemoryPressureMonitorChromeOS : public MemoryPressureMonitor {
|
| +class BASE_EXPORT MemoryPressureMonitor : public base::MemoryPressureMonitor {
|
| public:
|
| using GetUsedMemoryInPercentCallback = int (*)();
|
|
|
| @@ -49,8 +50,8 @@ class BASE_EXPORT MemoryPressureMonitorChromeOS : public MemoryPressureMonitor {
|
| THRESHOLD_AGGRESSIVE = 4
|
| };
|
|
|
| - explicit MemoryPressureMonitorChromeOS(MemoryPressureThresholds thresholds);
|
| - ~MemoryPressureMonitorChromeOS() override;
|
| + explicit MemoryPressureMonitor(MemoryPressureThresholds thresholds);
|
| + ~MemoryPressureMonitor() override;
|
|
|
| // Redo the memory pressure calculation soon and call again if a critical
|
| // memory pressure prevails. Note that this call will trigger an asynchronous
|
| @@ -90,7 +91,7 @@ class BASE_EXPORT MemoryPressureMonitorChromeOS : public MemoryPressureMonitor {
|
|
|
| // A periodic timer to check for resource pressure changes. This will get
|
| // replaced by a kernel triggered event system (see crbug.com/381196).
|
| - base::RepeatingTimer<MemoryPressureMonitorChromeOS> timer_;
|
| + base::RepeatingTimer<MemoryPressureMonitor> timer_;
|
|
|
| // To slow down the amount of moderate pressure event calls, this counter
|
| // gets used to count the number of events since the last event occured.
|
| @@ -103,11 +104,12 @@ class BASE_EXPORT MemoryPressureMonitorChromeOS : public MemoryPressureMonitor {
|
| // File descriptor used to detect low memory condition.
|
| ScopedFD low_mem_file_;
|
|
|
| - base::WeakPtrFactory<MemoryPressureMonitorChromeOS> weak_ptr_factory_;
|
| + base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitorChromeOS);
|
| + DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor);
|
| };
|
|
|
| +} // namespace chromeos
|
| } // namespace base
|
|
|
| -#endif // BASE_CHROMEOS_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_
|
| +#endif // BASE_CHROMEOS_MEMORY_PRESSURE_MONITOR_H_
|
|
|