Chromium Code Reviews| Index: base/memory/memory_coordinator_proxy.cc |
| diff --git a/base/memory/memory_coordinator_proxy.cc b/base/memory/memory_coordinator_proxy.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7e8527504102864bc63ca70631b8ca77699cb22b |
| --- /dev/null |
| +++ b/base/memory/memory_coordinator_proxy.cc |
| @@ -0,0 +1,30 @@ |
| +// 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_proxy.h" |
| + |
| +namespace base { |
| + |
| +MemoryCoordinatorProxy::MemoryCoordinatorProxy() { |
| +} |
| + |
| +MemoryCoordinatorProxy::~MemoryCoordinatorProxy() { |
| +} |
| + |
| +MemoryCoordinatorProxy* MemoryCoordinatorProxy::GetInstance() { |
| + return Singleton<base::MemoryCoordinatorProxy>::get(); |
| +} |
| + |
| +MemoryState MemoryCoordinatorProxy::GetCurrentMemoryState() const { |
| + if (!callback_) |
| + return MemoryState::NORMAL; |
|
haraken
2016/10/24 09:01:15
Is this an expected behavior?
I guess it's better
hajimehoshi
2016/10/24 10:56:52
Hmm, why we decided to use NORMAL as default is be
haraken
2016/10/24 11:35:39
I think the feature list should be initialized at
bashi
2016/10/24 23:35:57
It's probably true, but I think it's better to ret
|
| + return callback_.Run(); |
| +} |
| + |
| +void MemoryCoordinatorProxy::SetGetCurrentMemoryStateCallback( |
| + GetCurrentMemoryStateCallback callback) { |
| + callback_ = callback; |
| +} |
| + |
| +} // namespace base |