Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2025)

Unified Diff: content/public/browser/memory_pressure_controller.h

Issue 1641813002: Provide renderers with memory pressure signals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@contentapi
Patch Set: Addressed creis' comments. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/browser/memory_pressure_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/memory_pressure_controller.h
diff --git a/content/public/browser/memory_pressure_controller.h b/content/public/browser/memory_pressure_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..0108006d059e39a76db77cc3a3d1b177e47f2edc
--- /dev/null
+++ b/content/public/browser/memory_pressure_controller.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_
+#define CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_
+
+#include "base/memory/memory_pressure_listener.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+class BrowserChildProcessHost;
+class RenderProcessHost;
+
+// Allows content embedders to forward memory pressure events from the main
+// browser process to children processes. For more details see
+// content/browser/memory/memory_pressure_controller_impl.h.
+class CONTENT_EXPORT MemoryPressureController {
+ public:
+
+ // Sends a memory pressure notification to the specified browser child process
+ // via its attached MemoryMessageFilter. May be called on any thread.
+ static void SendPressureNotification(
+ const BrowserChildProcessHost* child_process_host,
+ base::MemoryPressureListener::MemoryPressureLevel level);
+
+ // Sends a memory pressure notification to the specified renderer process via
+ // its attached MemoryMessageFilter. May be called on any thread.
+ static void SendPressureNotification(
+ const RenderProcessHost* render_process_host,
+ base::MemoryPressureListener::MemoryPressureLevel level);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MemoryPressureController);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_
« no previous file with comments | « content/content_tests.gypi ('k') | content/public/browser/memory_pressure_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698