| 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/memory/memory_coordinator_client.h" | 9 #include "base/memory/memory_coordinator_client.h" |
| 10 #include "base/memory/memory_coordinator_proxy.h" | 10 #include "base/memory/memory_coordinator_proxy.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 // Returns the memory state of the specified render process. Returns UNKNOWN | 72 // Returns the memory state of the specified render process. Returns UNKNOWN |
| 73 // if the process is not tracked by this coordinator. | 73 // if the process is not tracked by this coordinator. |
| 74 MemoryState GetChildMemoryState(int render_process_id) const; | 74 MemoryState GetChildMemoryState(int render_process_id) const; |
| 75 | 75 |
| 76 // Records memory pressure notifications. Called by MemoryPressureMonitor. | 76 // Records memory pressure notifications. Called by MemoryPressureMonitor. |
| 77 // TODO(bashi): Remove this when MemoryPressureMonitor is retired. | 77 // TODO(bashi): Remove this when MemoryPressureMonitor is retired. |
| 78 void RecordMemoryPressure( | 78 void RecordMemoryPressure( |
| 79 base::MemoryPressureMonitor::MemoryPressureLevel level); | 79 base::MemoryPressureMonitor::MemoryPressureLevel level); |
| 80 | 80 |
| 81 // Returns the browser's current memory state. | |
| 82 MemoryState GetBrowserMemoryState() const; | |
| 83 | |
| 84 // base::MemoryCoordinator implementations: | 81 // base::MemoryCoordinator implementations: |
| 85 MemoryState GetCurrentMemoryState() const override; | 82 MemoryState GetCurrentMemoryState() const override; |
| 86 // Temporarily sets memory state of the browser process for testing. | 83 // Temporarily sets memory state of the browser process for testing. |
| 87 void SetCurrentMemoryStateForTesting(MemoryState memory_state) override; | 84 void SetCurrentMemoryStateForTesting(MemoryState memory_state) override; |
| 88 | 85 |
| 89 // content::MemoryCoordinator implementation: | 86 // content::MemoryCoordinator implementation: |
| 90 MemoryState GetStateForProcess(base::ProcessHandle handle) override; | 87 MemoryState GetStateForProcess(base::ProcessHandle handle) override; |
| 91 | 88 |
| 92 // NotificationObserver implementation: | 89 // NotificationObserver implementation: |
| 93 void Observe(int type, | 90 void Observe(int type, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // MemoryCoordinator and removed automatically when an underlying binding is | 212 // MemoryCoordinator and removed automatically when an underlying binding is |
| 216 // disconnected. | 213 // disconnected. |
| 217 ChildInfoMap children_; | 214 ChildInfoMap children_; |
| 218 | 215 |
| 219 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl); | 216 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl); |
| 220 }; | 217 }; |
| 221 | 218 |
| 222 } // namespace content | 219 } // namespace content |
| 223 | 220 |
| 224 #endif // CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ | 221 #endif // CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ |
| OLD | NEW |