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" |
(...skipping 18 matching lines...) Expand all Loading... |
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: |
39 friend class MemoryPressureController; | 39 friend class MemoryPressureControllerImpl; |
40 | 40 |
41 ~MemoryMessageFilter() override; | 41 ~MemoryMessageFilter() override; |
42 | 42 |
43 const void* process_host() const { return process_host_; } | 43 const void* process_host() const { return process_host_; } |
44 ProcessType process_type() const { return process_type_; } | 44 ProcessType process_type() const { return process_type_; } |
45 | 45 |
46 private: | 46 private: |
47 // The untyped process host and ProcessType associated with this filter | 47 // The untyped process host and ProcessType associated with this filter |
48 // instance. The process host is stored as untyped because it is only used as | 48 // instance. The process host is stored as untyped because it is only used as |
49 // a key in MemoryPressureController; at no point is it ever deferenced to | 49 // a key in MemoryPressureControllerImpl; at no point is it ever deferenced to |
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 |