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

Unified Diff: content/child/memory/child_memory_message_filter.cc

Issue 1362233003: Add architecture for simulating memory pressure notifications in all processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/child/memory/child_memory_message_filter.cc
diff --git a/content/child/memory/child_memory_message_filter.cc b/content/child/memory/child_memory_message_filter.cc
index 1f3515997714eee9fb3e9146f31adbcd6b645288..95da9d7e095afdd9157b6788fc61ec5f9489b720 100644
--- a/content/child/memory/child_memory_message_filter.cc
+++ b/content/child/memory/child_memory_message_filter.cc
@@ -4,7 +4,6 @@
#include "content/child/memory/child_memory_message_filter.h"
-#include "base/memory/memory_pressure_listener.h"
#include "content/common/memory_messages.h"
namespace content {
@@ -18,6 +17,8 @@ bool ChildMemoryMessageFilter::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(ChildMemoryMessageFilter, message)
IPC_MESSAGE_HANDLER(MemoryMsg_SetPressureNotificationsSuppressed,
OnSetPressureNotificationsSuppressed)
+ IPC_MESSAGE_HANDLER(MemoryMsg_SimulatePressureNotification,
+ OnSimulatePressureNotification)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -29,4 +30,10 @@ void ChildMemoryMessageFilter::OnSetPressureNotificationsSuppressed(
base::MemoryPressureListener::SetNotificationsSuppressed(suppressed);
}
+void ChildMemoryMessageFilter::OnSimulatePressureNotification(
+ MemoryPressureLevel level) {
+ // Simulate a memory pressure notification in the child process.
+ base::MemoryPressureListener::SimulatePressureNotification(level);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698