Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Side by Side Diff: content/browser/memory/memory_coordinator.cc

Issue 2448953002: Add MemoryCoordinatorProxy::SetCurrentMemoryStateForTesting (Closed)
Patch Set: Add tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/public/browser/content_browser_client.h" 8 #include "content/public/browser/content_browser_client.h"
9 #include "content/public/browser/render_process_host.h" 9 #include "content/public/browser/render_process_host.h"
10 #include "content/public/common/content_client.h" 10 #include "content/public/common/content_client.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); 125 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
126 feature_list->InitializeFromCommandLine(features::kMemoryCoordinator.name, 126 feature_list->InitializeFromCommandLine(features::kMemoryCoordinator.name,
127 ""); 127 "");
128 base::FeatureList::SetInstance(std::move(feature_list)); 128 base::FeatureList::SetInstance(std::move(feature_list));
129 } 129 }
130 130
131 base::MemoryState MemoryCoordinator::GetCurrentMemoryState() const { 131 base::MemoryState MemoryCoordinator::GetCurrentMemoryState() const {
132 return base::MemoryState::UNKNOWN; 132 return base::MemoryState::UNKNOWN;
133 } 133 }
134 134
135 void MemoryCoordinator::SetCurrentMemoryStateForTesting(
136 base::MemoryState memory_state) {
137 }
138
135 void MemoryCoordinator::AddChildForTesting( 139 void MemoryCoordinator::AddChildForTesting(
136 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { 140 int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) {
137 mojom::MemoryCoordinatorHandlePtr mch; 141 mojom::MemoryCoordinatorHandlePtr mch;
138 auto request = mojo::GetProxy(&mch); 142 auto request = mojo::GetProxy(&mch);
139 std::unique_ptr<MemoryCoordinatorHandleImpl> handle( 143 std::unique_ptr<MemoryCoordinatorHandleImpl> handle(
140 new MemoryCoordinatorHandleImpl(std::move(request), this, 144 new MemoryCoordinatorHandleImpl(std::move(request), this,
141 dummy_render_process_id)); 145 dummy_render_process_id));
142 handle->AddChild(std::move(child)); 146 handle->AddChild(std::move(child));
143 CreateChildInfoMapEntry(dummy_render_process_id, std::move(handle)); 147 CreateChildInfoMapEntry(dummy_render_process_id, std::move(handle));
144 } 148 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 184
181 MemoryCoordinator::ChildInfo::ChildInfo() {} 185 MemoryCoordinator::ChildInfo::ChildInfo() {}
182 186
183 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) { 187 MemoryCoordinator::ChildInfo::ChildInfo(const ChildInfo& rhs) {
184 // This is a nop, but exists for compatibility with STL containers. 188 // This is a nop, but exists for compatibility with STL containers.
185 } 189 }
186 190
187 MemoryCoordinator::ChildInfo::~ChildInfo() {} 191 MemoryCoordinator::ChildInfo::~ChildInfo() {}
188 192
189 } // namespace content 193 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/memory/memory_coordinator.h ('k') | content/browser/memory/memory_coordinator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698