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

Unified Diff: base/memory/memory_coordinator_proxy.cc

Issue 2434353003: Introduce MemoryCoordinatorProxy in base (Closed)
Patch Set: Address on reviews Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698