memory_purger.h revision 3345a6884c488ff3a535c2c9acdd33d74b37e311
1// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// MemoryPurger provides static APIs to purge as much memory as possible from
6// all processes.  These can be hooked to various signals to try and balance
7// memory consumption, speed, page swapping, etc.
8
9#ifndef CHROME_BROWSER_MEMORY_PURGER_H_
10#define CHROME_BROWSER_MEMORY_PURGER_H_
11#pragma once
12
13#include "base/basictypes.h"
14
15class RenderProcessHost;
16
17class MemoryPurger {
18 public:
19  // Call any of these on the UI thread to purge memory from the named places.
20  static void PurgeAll();
21  static void PurgeBrowser();
22  static void PurgeRenderers();
23  static void PurgeRendererForHost(RenderProcessHost* host);
24
25 private:
26  DISALLOW_IMPLICIT_CONSTRUCTORS(MemoryPurger);
27};
28
29#endif  // CHROME_BROWSER_MEMORY_PURGER_H_
30