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

Unified Diff: components/ukm/ukm_interface.cc

Issue 2882353002: Implement Ukm Mojo interface. (Closed)
Patch Set: Move example to comment Created 3 years, 7 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/ukm/ukm_interface.cc
diff --git a/components/ukm/ukm_interface.cc b/components/ukm/ukm_interface.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d89f6134470cb7056198b060306d227701b27761
--- /dev/null
+++ b/components/ukm/ukm_interface.cc
@@ -0,0 +1,30 @@
+// 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 "components/ukm/ukm_interface.h"
+
+#include "base/memory/ptr_util.h"
+#include "components/ukm/public/ukm_recorder.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace ukm {
+
+UkmInterface::UkmInterface(UkmRecorder* ukm_recorder)
+ : ukm_recorder_(ukm_recorder) {}
+
+UkmInterface::~UkmInterface() = default;
+
+// static
+void UkmInterface::Create(UkmRecorder* ukm_recorder,
+ const service_manager::BindSourceInfo& source_info,
+ mojom::UkmRecorderInterfaceRequest request) {
+ mojo::MakeStrongBinding(base::MakeUnique<UkmInterface>(ukm_recorder),
+ std::move(request));
+}
+
+void UkmInterface::AddEntry(mojom::UkmEntryPtr ukm_entry) {
+ ukm_recorder_->AddEntry(std::move(ukm_entry));
+}
+
+} // namespace ukm

Powered by Google App Engine
This is Rietveld 408576698