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

Unified Diff: services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.cc

Issue 2681003006: memory-infra: The client library (Closed)
Patch Set: review Created 3 years, 10 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
« no previous file with comments | « services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.cc
diff --git a/services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.cc b/services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..70e511a7c0ee81467d0467f05ce6427082739882
--- /dev/null
+++ b/services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.cc
@@ -0,0 +1,48 @@
+// Copyright 2017 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 "services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.h"
+
+#include "base/trace_event/memory_dump_request_args.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "services/memory_instrumentation/public/cpp/coordinator.h"
+#include "services/memory_instrumentation/public/interfaces/memory_instrumentation.mojom.h"
+#include "services/service_manager/public/cpp/interface_provider.h"
+
+namespace memory_instrumentation {
+
+MemoryDumpManagerDelegateImpl::MemoryDumpManagerDelegateImpl(
+ service_manager::InterfaceProvider* interface_provider)
+ : is_coordinator_(false), binding_(this) {
+ interface_provider->GetInterface(mojo::MakeRequest(&coordinator_));
+ coordinator_->RegisterProcessLocalDumpManager(
+ binding_.CreateInterfacePtrAndBind());
+}
+
+MemoryDumpManagerDelegateImpl::MemoryDumpManagerDelegateImpl(
+ Coordinator* coordinator) : is_coordinator_(true), binding_(this) {
+ coordinator->BindCoordinatorRequest(mojo::MakeRequest(&coordinator_));
+ coordinator_->RegisterProcessLocalDumpManager(
+ binding_.CreateInterfacePtrAndBind());
+}
+
+MemoryDumpManagerDelegateImpl::~MemoryDumpManagerDelegateImpl() {}
+
+bool MemoryDumpManagerDelegateImpl::IsCoordinator() const {
+ return is_coordinator_;
+}
+
+void MemoryDumpManagerDelegateImpl::RequestProcessMemoryDump(
+ const base::trace_event::MemoryDumpRequestArgs& args,
+ const RequestProcessMemoryDumpCallback& callback) {
+ MemoryDumpManagerDelegate::CreateProcessDump(args, callback);
+}
+
+void MemoryDumpManagerDelegateImpl::RequestGlobalMemoryDump(
+ const base::trace_event::MemoryDumpRequestArgs& args,
+ const base::trace_event::MemoryDumpCallback& callback) {
+ coordinator_->RequestGlobalMemoryDump(args, callback);
+}
+
+} // namespace memory_instrumentation
« no previous file with comments | « services/memory_instrumentation/public/cpp/memory_dump_manager_delegate_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698