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

Unified Diff: components/memory_coordinator/child/child_memory_coordinator_impl_android.cc

Issue 2260433006: Add delegate and factory function for ChildMemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: export Created 4 years, 4 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: components/memory_coordinator/child/child_memory_coordinator_impl_android.cc
diff --git a/components/memory_coordinator/child/child_memory_coordinator_impl_android.cc b/components/memory_coordinator/child/child_memory_coordinator_impl_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..976994c19850e5cc3030a9461a7dc9c246a4d861
--- /dev/null
+++ b/components/memory_coordinator/child/child_memory_coordinator_impl_android.cc
@@ -0,0 +1,29 @@
+// 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 "components/memory_coordinator/child/child_memory_coordinator_impl_android.h"
+
+namespace memory_coordinator {
+
+ChildMemoryCoordinatorImplAndroid::ChildMemoryCoordinatorImplAndroid(
+ mojom::MemoryCoordinatorHandlePtr parent,
+ ChildMemoryCoordinatorDelegate* delegate)
+ : ChildMemoryCoordinatorImpl(std::move(parent), delegate) {}
+
+ChildMemoryCoordinatorImplAndroid::~ChildMemoryCoordinatorImplAndroid() {}
+
+void ChildMemoryCoordinatorImplAndroid::OnTrimMemory(int level) {
+ // TODO(bashi): Compare |level| with levels defined in
+ // ComponentCallbacks2 when JNI bindings are implemented.
+ delegate()->OnTrimMemoryImmediately();
+}
+
+std::unique_ptr<ChildMemoryCoordinatorImpl> CreateChildMemoryCoordinator(
+ mojom::MemoryCoordinatorHandlePtr parent,
+ ChildMemoryCoordinatorDelegate* delegate) {
+ return base::WrapUnique(
+ new ChildMemoryCoordinatorImplAndroid(std::move(parent), delegate));
+}
+
+} // namespace memory_coordinator

Powered by Google App Engine
This is Rietveld 408576698