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

Unified Diff: components/metrics/single_value_histograms_provider.cc

Issue 2687583002: Add support for single sample metrics. (Closed)
Patch Set: Redesign! Created 3 years, 8 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/metrics/single_value_histograms_provider.cc
diff --git a/components/metrics/single_value_histograms_provider.cc b/components/metrics/single_value_histograms_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1dfcb58696b06e1f8eac3b0e31f276101ab72ea6
--- /dev/null
+++ b/components/metrics/single_value_histograms_provider.cc
@@ -0,0 +1,40 @@
+// 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/metrics/single_value_histograms_provider.h"
+
+#include "components/metrics/single_value_counts_histogram.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace metrics {
+
+// static
+void SingleValueHistogramsProvider::Create(
+ mojom::SingleValueHistogramsProviderRequest request) {
+ // TODO(dalecurtis): Is strong binding what we want here? Seems like we'd
+ // prefer this is lazily created and available forever more to RPHI.
+ mojo::MakeStrongBinding(base::MakeUnique<SingleValueHistogramsProvider>(),
+ std::move(request));
+}
+
+SingleValueHistogramsProvider::SingleValueHistogramsProvider() {
+ LOG(ERROR) << __func__;
+}
+
+SingleValueHistogramsProvider::~SingleValueHistogramsProvider() {
+ LOG(ERROR) << __func__;
+}
+
+void SingleValueHistogramsProvider::AcquireSingleValueCountsHistogram(
+ const std::string& name,
+ base::HistogramBase::Sample min,
+ base::HistogramBase::Sample max,
+ uint32_t bucket_count,
+ mojom::SingleValueCountsHistogramRequest request) {
+ mojo::MakeStrongBinding(base::MakeUnique<SingleValueCountsHistogram>(
+ name, min, max, bucket_count),
+ std::move(request));
+}
+
+} // namespace metrics

Powered by Google App Engine
This is Rietveld 408576698