| 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 #include "content/browser/memory/memory_coordinator.h" | 5 #include "content/browser/memory/memory_coordinator.h" |
| 6 | 6 |
| 7 #include "base/memory/memory_coordinator_client_registry.h" | 7 #include "base/memory/memory_coordinator_client_registry.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "content/public/browser/content_browser_client.h" | 9 #include "content/public/browser/content_browser_client.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: | 132 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: |
| 133 UMA_HISTOGRAM_ENUMERATION( | 133 UMA_HISTOGRAM_ENUMERATION( |
| 134 "Memory.Coordinator.StateOnCriticalNotificationReceived", | 134 "Memory.Coordinator.StateOnCriticalNotificationReceived", |
| 135 state, base::kMemoryStateMax); | 135 state, base::kMemoryStateMax); |
| 136 break; | 136 break; |
| 137 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: | 137 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: |
| 138 NOTREACHED(); | 138 NOTREACHED(); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 base::TimeDelta MemoryCoordinator::GetMonitoringInterval() const { |
| 143 return base::TimeDelta::FromSeconds(0); |
| 144 } |
| 145 |
| 142 base::MemoryState MemoryCoordinator::GetCurrentMemoryState() const { | 146 base::MemoryState MemoryCoordinator::GetCurrentMemoryState() const { |
| 143 return base::MemoryState::UNKNOWN; | 147 return base::MemoryState::UNKNOWN; |
| 144 } | 148 } |
| 145 | 149 |
| 146 void MemoryCoordinator::SetCurrentMemoryStateForTesting( | 150 void MemoryCoordinator::SetCurrentMemoryStateForTesting( |
| 147 base::MemoryState memory_state) { | 151 base::MemoryState memory_state) { |
| 148 } | 152 } |
| 149 | 153 |
| 150 void MemoryCoordinator::AddChildForTesting( | 154 void MemoryCoordinator::AddChildForTesting( |
| 151 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { | 155 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 199 |
| 196 MemoryCoordinator::ChildInfo::ChildInfo() {} | 200 MemoryCoordinator::ChildInfo::ChildInfo() {} |
| 197 | 201 |
| 198 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) { | 202 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) { |
| 199 // This is a nop, but exists for compatibility with STL containers. | 203 // This is a nop, but exists for compatibility with STL containers. |
| 200 } | 204 } |
| 201 | 205 |
| 202 MemoryCoordinator::ChildInfo::~ChildInfo() {} | 206 MemoryCoordinator::ChildInfo::~ChildInfo() {} |
| 203 | 207 |
| 204 } // namespace content | 208 } // namespace content |
| OLD | NEW |