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

Unified Diff: components/memory_coordinator/child/child_memory_coordinator_impl.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.cc
diff --git a/components/memory_coordinator/child/child_memory_coordinator_impl.cc b/components/memory_coordinator/child/child_memory_coordinator_impl.cc
index 8251827635868ca99a4b64fda8da72ec1ec3fecf..1e4a9c8ecd22df7664935112f75398660279c1ba 100644
--- a/components/memory_coordinator/child/child_memory_coordinator_impl.cc
+++ b/components/memory_coordinator/child/child_memory_coordinator_impl.cc
@@ -7,8 +7,10 @@
namespace memory_coordinator {
ChildMemoryCoordinatorImpl::ChildMemoryCoordinatorImpl(
- mojom::MemoryCoordinatorHandlePtr parent)
- : binding_(this), parent_(std::move(parent)) {
+ mojom::MemoryCoordinatorHandlePtr parent,
+ ChildMemoryCoordinatorDelegate* delegate)
+ : binding_(this), parent_(std::move(parent)), delegate_(delegate) {
+ DCHECK(delegate_);
parent_->AddChild(binding_.CreateInterfacePtrAndBind());
}
@@ -20,4 +22,13 @@ void ChildMemoryCoordinatorImpl::OnStateChange(mojom::MemoryState state) {
state);
}
+#if !defined(OS_ANDROID)
+std::unique_ptr<ChildMemoryCoordinatorImpl> CreateChildMemoryCoordinator(
+ mojom::MemoryCoordinatorHandlePtr parent,
+ ChildMemoryCoordinatorDelegate* delegate) {
+ return base::WrapUnique(
+ new ChildMemoryCoordinatorImpl(std::move(parent), delegate));
+}
+#endif
+
} // namespace memory_coordinator

Powered by Google App Engine
This is Rietveld 408576698