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

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

Issue 1640423002: Make memory pressure IPC accessible from content/public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/public/browser/memory_pressure.h
diff --git a/content/public/browser/memory_pressure.h b/content/public/browser/memory_pressure.h
new file mode 100644
index 0000000000000000000000000000000000000000..46a50eca6e51e9d5aa203da9ba69c999e7918d87
--- /dev/null
+++ b/content/public/browser/memory_pressure.h
@@ -0,0 +1,30 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
petrcermak 2016/01/28 09:55:05 nit: Drop "(c)" (https://www.chromium.org/develope
chrisha 2016/01/28 21:22:14 Done.
+// 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_H_
+#define CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_H_
+
+#include "base/memory/memory_pressure_listener.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+class BrowserChildProcessHost;
+class MemoryMessageFilter;
Charlie Reis 2016/01/27 22:34:22 Why is this needed?
chrisha 2016/01/28 21:22:14 Oops.. cut and paste error. Not needed, and remove
+class RenderProcessHost;
+
+// Wrappers around singleton member functions in
+// content/browser/memory/memory_pressure_controller. See that header for more
Charlie Reis 2016/01/27 22:34:23 nit: Add .h. Also, there's no additional details
chrisha 2016/01/28 21:22:14 Added more comments.
+// details. These are exposed so that chrome/browser can interact with the
+// content memory pressure subsystem. These may be called from any thread.
+CONTENT_EXPORT void SendPressureNotification(
Charlie Reis 2016/01/27 22:34:22 I think it's generally preferred to have these in
chrisha 2016/01/28 21:22:14 I only mean to expose a few functions on MemoryPre
+ const BrowserChildProcessHost* child_process_host,
+ base::MemoryPressureListener::MemoryPressureLevel level);
+CONTENT_EXPORT void SendPressureNotification(
+ const RenderProcessHost* render_process_host,
+ base::MemoryPressureListener::MemoryPressureLevel level);
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_MEMORY_MEMORY_PRESSURE_H_

Powered by Google App Engine
This is Rietveld 408576698