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