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

Unified Diff: components/ukm/ukm_rotation_scheduler.h

Issue 2770853002: Create Ukm ReportingService implementation. (Closed)
Patch Set: Also revert datatracker unittest change Created 3 years, 9 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 | « components/ukm/ukm_reporting_service.cc ('k') | components/ukm/ukm_rotation_scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_rotation_scheduler.h
diff --git a/components/ukm/ukm_rotation_scheduler.h b/components/ukm/ukm_rotation_scheduler.h
new file mode 100644
index 0000000000000000000000000000000000000000..5c835277ea8a550d1a6f490a43044b669c992fe5
--- /dev/null
+++ b/components/ukm/ukm_rotation_scheduler.h
@@ -0,0 +1,33 @@
+// 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.
+
+#ifndef COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_
+#define COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_
+
+#include "base/time/time.h"
+#include "components/metrics/metrics_rotation_scheduler.h"
+
+namespace ukm {
+
+// Scheduler to drive a UkmService object's log rotations.
+class UkmRotationScheduler : public metrics::MetricsRotationScheduler {
+ public:
+ // Creates UkmRotationScheduler object with the given |rotation_callback|
+ // callback to call when log rotation should happen and |interval_callback|
+ // to determine the interval between rotations in steady state.
+ UkmRotationScheduler(
+ const base::Closure& rotation_callback,
+ const base::Callback<base::TimeDelta(void)>& interval_callback);
+ ~UkmRotationScheduler() override;
+
+ private:
+ // Record the init sequence order histogram.
+ void LogMetricsInitSequence(InitSequence sequence) override;
+
+ DISALLOW_COPY_AND_ASSIGN(UkmRotationScheduler);
+};
+
+} // namespace ukm
+
+#endif // COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_
« no previous file with comments | « components/ukm/ukm_reporting_service.cc ('k') | components/ukm/ukm_rotation_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698