| Index: base/memory/memory_pressure_monitor_win.cc
|
| diff --git a/base/memory/memory_pressure_monitor_win.cc b/base/memory/memory_pressure_monitor_win.cc
|
| index 4349d035806c3efe6689c0846b7d787a11e467ce..9e50444a62f52bc64f68e83a0befe12ccbd3bbf3 100644
|
| --- a/base/memory/memory_pressure_monitor_win.cc
|
| +++ b/base/memory/memory_pressure_monitor_win.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "base/memory/memory_pressure_monitor_win.h"
|
| +#include "base/memory/memory_pressure_monitor.h"
|
|
|
| #include <windows.h>
|
|
|
| @@ -12,7 +12,6 @@
|
| #include "base/time/time.h"
|
|
|
| namespace base {
|
| -namespace win {
|
|
|
| namespace {
|
|
|
| @@ -95,12 +94,18 @@ MemoryPressureMonitor::MemoryPressureMonitor(int moderate_threshold_mb,
|
| MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE),
|
| moderate_pressure_repeat_count_(0),
|
| weak_ptr_factory_(this) {
|
| + DCHECK(!g_monitor);
|
| + g_monitor = this;
|
| +
|
| DCHECK_GE(moderate_threshold_mb_, critical_threshold_mb_);
|
| DCHECK_LE(0, critical_threshold_mb_);
|
| StartObserving();
|
| }
|
|
|
| MemoryPressureMonitor::~MemoryPressureMonitor() {
|
| + DCHECK(g_monitor);
|
| + g_monitor = nullptr;
|
| +
|
| StopObserving();
|
| }
|
|
|
| @@ -250,5 +255,4 @@ bool MemoryPressureMonitor::GetSystemMemoryStatus(
|
| return true;
|
| }
|
|
|
| -} // namespace win
|
| } // namespace base
|
|
|