OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/memory_pressure_listener.h" | 9 #include "base/memory/memory_pressure_listener.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "content/public/browser/browser_message_filter.h" | 11 #include "content/public/browser/browser_message_filter.h" |
12 #include "content/public/common/process_type.h" | 12 #include "content/public/common/process_type.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class BrowserChildProcessHost; | 16 class BrowserChildProcessHost; |
17 class RenderProcessHost; | 17 class RenderProcessHost; |
18 | 18 |
19 // This class sends memory messages from the browser process. | 19 // This class sends memory messages from the browser process. |
20 // See also: child_memory_message_filter.h | 20 // See also: child_memory_message_filter.h |
21 class CONTENT_EXPORT MemoryMessageFilter : public BrowserMessageFilter { | 21 class CONTENT_EXPORT MemoryMessageFilter : public BrowserMessageFilter { |
22 public: | 22 public: |
23 MemoryMessageFilter(const BrowserChildProcessHost* child_process_host, | 23 MemoryMessageFilter(const BrowserChildProcessHost* child_process_host, |
24 ProcessType process_type); | 24 ProcessType process_type); |
25 MemoryMessageFilter(const RenderProcessHost* render_process_host); | 25 MemoryMessageFilter(const RenderProcessHost* render_process_host); |
26 | 26 |
27 // BrowserMessageFilter implementation. | 27 // BrowserMessageFilter implementation. |
28 void OnFilterAdded(IPC::Sender* sender) override; | 28 void OnFilterAdded(IPC::Channel* channel) override; |
29 void OnChannelClosing() override; | 29 void OnChannelClosing() override; |
30 bool OnMessageReceived(const IPC::Message& message) override; | 30 bool OnMessageReceived(const IPC::Message& message) override; |
31 | 31 |
32 void SendSetPressureNotificationsSuppressed(bool suppressed); | 32 void SendSetPressureNotificationsSuppressed(bool suppressed); |
33 void SendSimulatePressureNotification( | 33 void SendSimulatePressureNotification( |
34 base::MemoryPressureListener::MemoryPressureLevel level); | 34 base::MemoryPressureListener::MemoryPressureLevel level); |
35 void SendPressureNotification( | 35 void SendPressureNotification( |
36 base::MemoryPressureListener::MemoryPressureLevel level); | 36 base::MemoryPressureListener::MemoryPressureLevel level); |
37 | 37 |
38 protected: | 38 protected: |
(...skipping 11 matching lines...) Expand all Loading... |
50 // invoke any members on a process host. | 50 // invoke any members on a process host. |
51 const void* process_host_; | 51 const void* process_host_; |
52 ProcessType process_type_; | 52 ProcessType process_type_; |
53 | 53 |
54 DISALLOW_COPY_AND_ASSIGN(MemoryMessageFilter); | 54 DISALLOW_COPY_AND_ASSIGN(MemoryMessageFilter); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace content | 57 } // namespace content |
58 | 58 |
59 #endif // CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ | 59 #endif // CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ |
OLD | NEW |