| Index: base/memory/memory_coordinator_client_registry.cc
|
| diff --git a/base/memory/memory_coordinator_client_registry.cc b/base/memory/memory_coordinator_client_registry.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..59cd8ac135e57451b5c0d613de597879468e39fb
|
| --- /dev/null
|
| +++ b/base/memory/memory_coordinator_client_registry.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 "base/memory/memory_coordinator_client_registry.h"
|
| +
|
| +namespace base {
|
| +
|
| +// static
|
| +MemoryCoordinatorClientRegistry*
|
| +MemoryCoordinatorClientRegistry::GetInstance() {
|
| + return Singleton<
|
| + MemoryCoordinatorClientRegistry,
|
| + LeakySingletonTraits<MemoryCoordinatorClientRegistry>>::get();
|
| +}
|
| +
|
| +MemoryCoordinatorClientRegistry::MemoryCoordinatorClientRegistry()
|
| + : clients_(new ClientList) {}
|
| +
|
| +MemoryCoordinatorClientRegistry::~MemoryCoordinatorClientRegistry() {}
|
| +
|
| +void MemoryCoordinatorClientRegistry::Register(
|
| + MemoryCoordinatorClient* client) {
|
| + clients_->AddObserver(client);
|
| +}
|
| +
|
| +void MemoryCoordinatorClientRegistry::Unregister(
|
| + MemoryCoordinatorClient* client) {
|
| + clients_->RemoveObserver(client);
|
| +}
|
| +
|
| +} // namespace base
|
|
|