#include "third_party/blink/renderer/platform/scheduler/main_thread/memory_purge_manager.h"
#include "base/feature_list.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/metrics/field_trial_params.h"
#include "base/rand_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "third_party/blink/public/platform/platform.h"
namespace blink {
namespace {
BASE_FEATURE(…);
const base::FeatureParam<base::TimeDelta> kMemoryPurgeInBackgroundMinDelay{ … };
const base::FeatureParam<base::TimeDelta> kMemoryPurgeInBackgroundMaxDelay{ … };
}
MemoryPurgeManager::MemoryPurgeManager(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) { … }
MemoryPurgeManager::~MemoryPurgeManager() = default;
void MemoryPurgeManager::OnPageCreated() { … }
void MemoryPurgeManager::OnPageDestroyed(bool frozen) { … }
void MemoryPurgeManager::OnPageFrozen(
base::MemoryReductionTaskContext called_from) { … }
void MemoryPurgeManager::OnPageResumed() { … }
void MemoryPurgeManager::SetRendererBackgrounded(bool backgrounded) { … }
void MemoryPurgeManager::OnRendererBackgrounded() { … }
void MemoryPurgeManager::OnRendererForegrounded() { … }
void MemoryPurgeManager::RequestMemoryPurgeWithDelay(base::TimeDelta delay) { … }
void MemoryPurgeManager::PerformMemoryPurge() { … }
bool MemoryPurgeManager::CanPurge() const { … }
bool MemoryPurgeManager::AreAllPagesFrozen() const { … }
base::TimeDelta MemoryPurgeManager::GetTimeToPurgeAfterBackgrounded() const { … }
}