| Index: components/memory_pressure/direct_memory_pressure_calculator_win.h
|
| diff --git a/components/memory_pressure/direct_memory_pressure_calculator.h b/components/memory_pressure/direct_memory_pressure_calculator_win.h
|
| similarity index 96%
|
| copy from components/memory_pressure/direct_memory_pressure_calculator.h
|
| copy to components/memory_pressure/direct_memory_pressure_calculator_win.h
|
| index a2bb60e46a98b470e9a5ecbbd0effebbf9a4cd2e..10e2d24e285758a1fc1343b596b8a3f122849ed8 100644
|
| --- a/components/memory_pressure/direct_memory_pressure_calculator.h
|
| +++ b/components/memory_pressure/direct_memory_pressure_calculator_win.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 COMPONENTS_MEMORY_PRESSURE_DIRECT_MEMORY_PRESSURE_CALCULATOR_H_
|
| -#define COMPONENTS_MEMORY_PRESSURE_DIRECT_MEMORY_PRESSURE_CALCULATOR_H_
|
| +#ifndef COMPONENTS_MEMORY_PRESSURE_DIRECT_MEMORY_PRESSURE_CALCULATOR_WIN_H_
|
| +#define COMPONENTS_MEMORY_PRESSURE_DIRECT_MEMORY_PRESSURE_CALCULATOR_WIN_H_
|
|
|
| #include "components/memory_pressure/memory_pressure_calculator.h"
|
|
|
| @@ -21,7 +21,6 @@ namespace memory_pressure {
|
| // the appropriate subsystem (Android, Mac OS X).
|
| class DirectMemoryPressureCalculator : public MemoryPressureCalculator {
|
| public:
|
| -#if defined(OS_WIN)
|
| // Exposed for unittesting. See .cc file for detailed discussion of these
|
| // constants.
|
| static const int kLargeMemoryThresholdMb;
|
| @@ -29,7 +28,6 @@ class DirectMemoryPressureCalculator : public MemoryPressureCalculator {
|
| static const int kSmallMemoryDefaultCriticalThresholdMb;
|
| static const int kLargeMemoryDefaultModerateThresholdMb;
|
| static const int kLargeMemoryDefaultCriticalThresholdMb;
|
| -#endif
|
|
|
| // Default constructor. Will choose thresholds automatically based on the
|
| // actual amount of system memory installed.
|
| @@ -45,10 +43,8 @@ class DirectMemoryPressureCalculator : public MemoryPressureCalculator {
|
| // Calculates the current pressure level.
|
| MemoryPressureLevel CalculateCurrentPressureLevel() override;
|
|
|
| -#if defined(OS_WIN)
|
| int moderate_threshold_mb() const { return moderate_threshold_mb_; }
|
| int critical_threshold_mb() const { return critical_threshold_mb_; }
|
| -#endif
|
|
|
| private:
|
| friend class TestDirectMemoryPressureCalculator;
|
| @@ -57,7 +53,6 @@ class DirectMemoryPressureCalculator : public MemoryPressureCalculator {
|
| // default this invokes base::GetSystemMemoryInfo.
|
| virtual bool GetSystemMemoryInfo(base::SystemMemoryInfoKB* mem_info) const;
|
|
|
| -#if defined(OS_WIN)
|
| // Uses GetSystemMemoryInfo to automatically infer appropriate values for
|
| // moderate_threshold_mb_ and critical_threshold_mb_.
|
| void InferThresholds();
|
| @@ -67,7 +62,6 @@ class DirectMemoryPressureCalculator : public MemoryPressureCalculator {
|
| // these.
|
| int moderate_threshold_mb_;
|
| int critical_threshold_mb_;
|
| -#endif
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DirectMemoryPressureCalculator);
|
| };
|
| @@ -76,4 +70,4 @@ class DirectMemoryPressureCalculator : public MemoryPressureCalculator {
|
|
|
| } // namespace memory_pressure
|
|
|
| -#endif // COMPONENTS_MEMORY_PRESSURE_DIRECT_MEMORY_PRESSURE_CALCULATOR_H_
|
| +#endif // COMPONENTS_MEMORY_PRESSURE_DIRECT_MEMORY_PRESSURE_CALCULATOR_WIN_H_
|
|
|