OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COORDINATOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ |
6 #define CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/cancelable_callback.h" | 9 #include "base/cancelable_callback.h" |
10 #include "base/memory/memory_coordinator_client.h" | 10 #include "base/memory/memory_coordinator_client.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // the process is tracked by this coordinator and successfully dispatches, | 104 // the process is tracked by this coordinator and successfully dispatches, |
105 // returns false otherwise. | 105 // returns false otherwise. |
106 bool SetChildMemoryState(int render_process_id, MemoryState memory_state); | 106 bool SetChildMemoryState(int render_process_id, MemoryState memory_state); |
107 | 107 |
108 // Tries to purge memory from the browser process. | 108 // Tries to purge memory from the browser process. |
109 bool TryToPurgeMemoryFromBrowser(); | 109 bool TryToPurgeMemoryFromBrowser(); |
110 | 110 |
111 // Tries to purge memory from the provided child process. | 111 // Tries to purge memory from the provided child process. |
112 bool TryToPurgeMemoryFromChild(int render_process_id); | 112 bool TryToPurgeMemoryFromChild(int render_process_id); |
113 | 113 |
114 // Records memory pressure notifications. Called by MemoryPressureMonitor. | |
115 // TODO(bashi): Remove this when MemoryPressureMonitor is retired. | |
116 void RecordMemoryPressure( | |
117 base::MemoryPressureMonitor::MemoryPressureLevel level); | |
118 | |
119 // base::MemoryCoordinator implementations: | 114 // base::MemoryCoordinator implementations: |
120 MemoryState GetCurrentMemoryState() const override; | 115 MemoryState GetCurrentMemoryState() const override; |
121 | 116 |
122 // content::MemoryCoordinator implementation: | 117 // content::MemoryCoordinator implementation: |
123 MemoryState GetStateForProcess(base::ProcessHandle handle) override; | 118 MemoryState GetStateForProcess(base::ProcessHandle handle) override; |
124 | 119 |
125 // NotificationObserver implementation: | 120 // NotificationObserver implementation: |
126 void Observe(int type, | 121 void Observe(int type, |
127 const NotificationSource& source, | 122 const NotificationSource& source, |
128 const NotificationDetails& details) override; | 123 const NotificationDetails& details) override; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 ChildInfoMap children_; | 241 ChildInfoMap children_; |
247 | 242 |
248 SEQUENCE_CHECKER(sequence_checker_); | 243 SEQUENCE_CHECKER(sequence_checker_); |
249 | 244 |
250 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl); | 245 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl); |
251 }; | 246 }; |
252 | 247 |
253 } // namespace content | 248 } // namespace content |
254 | 249 |
255 #endif // CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ | 250 #endif // CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ |
OLD | NEW |