Home | History | Annotate | Download | only in browser
      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 
     15 class RenderProcessHost;
     16 
     17 class 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