NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / memory_purger.h
blob2d701b722679e59a189b8b45958fce46f3171b08
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.
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 // This was implemented in an attempt to speed up suspend-to-disk by throwing
10 // away any cached data that can be recomputed. Memory use will rapidly
11 // re-expand after this purge is run.
13 #ifndef CHROME_BROWSER_MEMORY_PURGER_H_
14 #define CHROME_BROWSER_MEMORY_PURGER_H_
16 #include "base/basictypes.h"
18 namespace content {
19 class RenderProcessHost;
22 class MemoryPurger {
23 public:
24 // Call any of these on the UI thread to purge memory from the named places.
25 static void PurgeAll();
26 static void PurgeBrowser();
27 static void PurgeRenderers();
28 static void PurgeRendererForHost(content::RenderProcessHost* host);
30 private:
31 DISALLOW_IMPLICIT_CONSTRUCTORS(MemoryPurger);
34 #endif // CHROME_BROWSER_MEMORY_PURGER_H_