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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 break; | 130 break; |
131 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: | 131 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: |
132 NOTREACHED(); | 132 NOTREACHED(); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 base::MemoryState MemoryCoordinator::GetGlobalMemoryState() const { | 136 base::MemoryState MemoryCoordinator::GetGlobalMemoryState() const { |
137 return base::MemoryState::UNKNOWN; | 137 return base::MemoryState::UNKNOWN; |
138 } | 138 } |
139 | 139 |
140 base::MemoryState MemoryCoordinator::GetCurrentMemoryState() const { | 140 base::WeakPtr<base::MemoryCoordinatorInterface> |
141 return base::MemoryState::UNKNOWN; | 141 MemoryCoordinator::GetWeakPtr() { |
142 } | 142 NOTREACHED(); |
143 | 143 return nullptr; |
144 void MemoryCoordinator::SetCurrentMemoryStateForTesting( | |
145 base::MemoryState memory_state) { | |
146 } | 144 } |
147 | 145 |
148 void MemoryCoordinator::AddChildForTesting( | 146 void MemoryCoordinator::AddChildForTesting( |
149 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { | 147 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { |
150 mojom::MemoryCoordinatorHandlePtr mch; | 148 mojom::MemoryCoordinatorHandlePtr mch; |
151 auto request = mojo::GetProxy(&mch); | 149 auto request = mojo::GetProxy(&mch); |
152 std::unique_ptr<MemoryCoordinatorHandleImpl> handle( | 150 std::unique_ptr<MemoryCoordinatorHandleImpl> handle( |
153 new MemoryCoordinatorHandleImpl(std::move(request), this, | 151 new MemoryCoordinatorHandleImpl(std::move(request), this, |
154 dummy_render_process_id)); | 152 dummy_render_process_id)); |
155 handle->AddChild(std::move(child)); | 153 handle->AddChild(std::move(child)); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 206 |
209 MemoryCoordinator::ChildInfo::ChildInfo() {} | 207 MemoryCoordinator::ChildInfo::ChildInfo() {} |
210 | 208 |
211 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) { | 209 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) { |
212 // This is a nop, but exists for compatibility with STL containers. | 210 // This is a nop, but exists for compatibility with STL containers. |
213 } | 211 } |
214 | 212 |
215 MemoryCoordinator::ChildInfo::~ChildInfo() {} | 213 MemoryCoordinator::ChildInfo::~ChildInfo() {} |
216 | 214 |
217 } // namespace content | 215 } // namespace content |
OLD | NEW |