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

Unified Diff: components/sync_driver/device_count_metrics_provider.cc

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. 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/sync_driver/device_count_metrics_provider.cc
diff --git a/components/sync_driver/device_count_metrics_provider.cc b/components/sync_driver/device_count_metrics_provider.cc
deleted file mode 100644
index 7467bc678bb6a7b7e26b50c3aa7c117f4ef5091a..0000000000000000000000000000000000000000
--- a/components/sync_driver/device_count_metrics_provider.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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/sync_driver/device_count_metrics_provider.h"
-
-#include <algorithm>
-
-#include "base/metrics/sparse_histogram.h"
-#include "components/sync_driver/device_info_tracker.h"
-
-namespace sync_driver {
-
-DeviceCountMetricsProvider::DeviceCountMetricsProvider(
- const ProvideTrackersCallback& provide_trackers)
- : provide_trackers_(provide_trackers) {}
-
-DeviceCountMetricsProvider::~DeviceCountMetricsProvider() {}
-
-int DeviceCountMetricsProvider::MaxActiveDeviceCount() const {
- std::vector<const sync_driver::DeviceInfoTracker*> trackers;
- provide_trackers_.Run(&trackers);
- int max = 0;
- for (auto* tracker : trackers) {
- max = std::max(max, tracker->CountActiveDevices());
- }
- return max;
-}
-
-void DeviceCountMetricsProvider::ProvideGeneralMetrics(
- metrics::ChromeUserMetricsExtension* uma_proto) {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Sync.DeviceCount",
- std::min(MaxActiveDeviceCount(), 100));
-}
-
-} // namespace sync_driver

Powered by Google App Engine
This is Rietveld 408576698