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 return nullptr; |
haraken
2016/12/12 06:51:57
NOT_REACHED() ?
bashi
2016/12/12 07:17:55
Done.
| |
143 | |
144 void MemoryCoordinator::SetCurrentMemoryStateForTesting( | |
145 base::MemoryState memory_state) { | |
146 } | 143 } |
147 | 144 |
148 void MemoryCoordinator::AddChildForTesting( | 145 void MemoryCoordinator::AddChildForTesting( |
149 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { | 146 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { |
150 mojom::MemoryCoordinatorHandlePtr mch; | 147 mojom::MemoryCoordinatorHandlePtr mch; |
151 auto request = mojo::GetProxy(&mch); | 148 auto request = mojo::GetProxy(&mch); |
152 std::unique_ptr<MemoryCoordinatorHandleImpl> handle( | 149 std::unique_ptr<MemoryCoordinatorHandleImpl> handle( |
153 new MemoryCoordinatorHandleImpl(std::move(request), this, | 150 new MemoryCoordinatorHandleImpl(std::move(request), this, |
154 dummy_render_process_id)); | 151 dummy_render_process_id)); |
155 handle->AddChild(std::move(child)); | 152 handle->AddChild(std::move(child)); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
208 | 205 |
209 MemoryCoordinator::ChildInfo::ChildInfo() {} | 206 MemoryCoordinator::ChildInfo::ChildInfo() {} |
210 | 207 |
211 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) { | 208 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) { |
212 // This is a nop, but exists for compatibility with STL containers. | 209 // This is a nop, but exists for compatibility with STL containers. |
213 } | 210 } |
214 | 211 |
215 MemoryCoordinator::ChildInfo::~ChildInfo() {} | 212 MemoryCoordinator::ChildInfo::~ChildInfo() {} |
216 | 213 |
217 } // namespace content | 214 } // namespace content |
OLD | NEW |