OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #ifndef CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_ |
| 7 |
| 8 #include "base/memory/memory_pressure_listener.h" |
| 9 #include "content/common/content_export.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 class BrowserChildProcessHost; |
| 14 class RenderProcessHost; |
| 15 |
| 16 // Allows content embedders to forward memory pressure events from the main |
| 17 // browser process to children processes. For more details see |
| 18 // content/browser/memory/memory_pressure_controller_impl.h. |
| 19 class CONTENT_EXPORT MemoryPressureController { |
| 20 public: |
| 21 |
| 22 // Sends a memory pressure notification to the specified browser child process |
| 23 // via its attached MemoryMessageFilter. May be called on any thread. |
| 24 static void SendPressureNotification( |
| 25 const BrowserChildProcessHost* child_process_host, |
| 26 base::MemoryPressureListener::MemoryPressureLevel level); |
| 27 |
| 28 // Sends a memory pressure notification to the specified renderer process via |
| 29 // its attached MemoryMessageFilter. May be called on any thread. |
| 30 static void SendPressureNotification( |
| 31 const RenderProcessHost* render_process_host, |
| 32 base::MemoryPressureListener::MemoryPressureLevel level); |
| 33 |
| 34 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(MemoryPressureController); |
| 36 }; |
| 37 |
| 38 } // namespace content |
| 39 |
| 40 #endif // CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_ |
OLD | NEW |