Chromium Code Reviews| Index: content/public/browser/memory_coordinator_delegate.cc |
| diff --git a/content/public/browser/memory_coordinator_delegate.cc b/content/public/browser/memory_coordinator_delegate.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..39eca64104e8e4ae7b56fa40182ddfd27fe4902d |
| --- /dev/null |
| +++ b/content/public/browser/memory_coordinator_delegate.cc |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/public/browser/memory_coordinator_delegate.h" |
| + |
| +#include "base/memory/memory_coordinator_proxy.h" |
| +#include "content/browser/memory/memory_coordinator.h" |
| +#include "content/public/common/content_features.h" |
| + |
| +namespace content { |
| + |
| +void EnableFeaturesForTesting() { |
|
bashi
2016/11/03 23:31:18
Can we put these implementations in content/browse
hajimehoshi
2016/11/07 10:54:32
It looks like we can have implementations in conte
|
| + base::FeatureList::ClearInstanceForTesting(); |
| + std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| + feature_list->InitializeFromCommandLine(features::kMemoryCoordinator.name, |
| + ""); |
| + base::FeatureList::SetInstance(std::move(feature_list)); |
| +} |
| + |
| +void SetUpMemoryCoordinatorProxyForTesting() { |
| + base::MemoryCoordinatorProxy::GetInstance()-> |
| + SetGetCurrentMemoryStateCallback(base::Bind( |
| + &content::MemoryCoordinator::GetCurrentMemoryState, |
| + base::Unretained(content::MemoryCoordinator::GetInstance()))); |
| + base::MemoryCoordinatorProxy::GetInstance()-> |
| + SetSetCurrentMemoryStateForTestingCallback(base::Bind( |
| + &content::MemoryCoordinator::SetCurrentMemoryStateForTesting, |
| + base::Unretained(content::MemoryCoordinator::GetInstance()))); |
| +} |
| + |
| +} // namespace content |