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

Unified Diff: content/child/memory_pressure_message_filter.cc

Issue 17351006: MemoryPressure: sends the signal to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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_pressure_message_filter.cc
diff --git a/content/child/memory_pressure_message_filter.cc b/content/child/memory_pressure_message_filter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..605dd6238f9c033a784bc62ddbcfc517a2012fb7
--- /dev/null
+++ b/content/child/memory_pressure_message_filter.cc
@@ -0,0 +1,34 @@
+// Copyright 2013 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.
+
+#include "content/child/memory_pressure_message_filter.h"
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "content/common/memory_pressure_messages.h"
+
+namespace content {
+
+MemoryPressureMessageFilter::MemoryPressureMessageFilter() {
+}
+
+bool MemoryPressureMessageFilter::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(MemoryPressureMessageFilter, msg)
+ IPC_MESSAGE_HANDLER(MemoryPressureMsg_MemoryPressure,
+ OnMemoryPressure)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+MemoryPressureMessageFilter::~MemoryPressureMessageFilter() {
+}
+
+void MemoryPressureMessageFilter::OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel level) {
+ base::MemoryPressureListener::NotifyMemoryPressure(level);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698