OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #include "content/child/memory/child_memory_message_filter.h" |
| 6 |
| 7 #include "base/memory/memory_pressure_listener.h" |
| 8 #include "content/common/memory_messages.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 ChildMemoryMessageFilter::ChildMemoryMessageFilter() {} |
| 13 |
| 14 ChildMemoryMessageFilter::~ChildMemoryMessageFilter() {} |
| 15 |
| 16 bool ChildMemoryMessageFilter::OnMessageReceived(const IPC::Message& message) { |
| 17 bool handled = true; |
| 18 IPC_BEGIN_MESSAGE_MAP(ChildMemoryMessageFilter, message) |
| 19 IPC_MESSAGE_HANDLER(MemoryMsg_SetPressureNotificationsSuppressed, |
| 20 OnSetPressureNotificationsSuppressed) |
| 21 IPC_MESSAGE_UNHANDLED(handled = false) |
| 22 IPC_END_MESSAGE_MAP() |
| 23 return handled; |
| 24 } |
| 25 |
| 26 void ChildMemoryMessageFilter::OnSetPressureNotificationsSuppressed( |
| 27 bool suppressed) { |
| 28 // Enable/disable suppressing memory notifications in the child process. |
| 29 base::MemoryPressureListener::SetNotificationsSuppressed(suppressed); |
| 30 } |
| 31 |
| 32 } // namespace content |
OLD | NEW |