Upload upstream chromium 114.0.5735.31
[platform/framework/web/chromium-efl.git] / components / ukm / ukm_rotation_scheduler.h
1 // Copyright 2017 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_UKM_UKM_ROTATION_SCHEDULER_H_
6 #define COMPONENTS_UKM_UKM_ROTATION_SCHEDULER_H_
7
8 #include "base/time/time.h"
9 #include "components/metrics/metrics_rotation_scheduler.h"
10
11 namespace ukm {
12
13 // Scheduler to drive a UkmService object's log rotations.
14 class UkmRotationScheduler : public metrics::MetricsRotationScheduler {
15  public:
16   // Creates UkmRotationScheduler object with the given |rotation_callback|
17   // callback to call when log rotation should happen and |interval_callback|
18   // to determine the interval between rotations in steady state.
19   UkmRotationScheduler(
20       const base::RepeatingClosure& rotation_callback,
21       bool fast_startup_for_testing,
22       const base::RepeatingCallback<base::TimeDelta(void)>& interval_callback);
23
24   UkmRotationScheduler(const UkmRotationScheduler&) = delete;
25   UkmRotationScheduler& operator=(const UkmRotationScheduler&) = delete;
26
27   ~UkmRotationScheduler() override;
28
29  private:
30   // Record the init sequence order histogram.
31   void LogMetricsInitSequence(InitSequence sequence) override;
32 };
33
34 }  // namespace ukm
35
36 #endif  // COMPONENTS_UKM_UKM_ROTATION_SCHEDULER_H_