• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 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_METRICS_ENTROPY_STATE_PROVIDER_H_
6 #define COMPONENTS_METRICS_ENTROPY_STATE_PROVIDER_H_
7 
8 #include "components/metrics/entropy_state.h"
9 #include "components/metrics/metrics_provider.h"
10 
11 class PrefService;
12 
13 namespace metrics {
14 
15 // EntropyStateProvider adds information about low entropy sources in the system
16 // profile. This includes |low_entropy_source|, |old_low_entropy_source| and
17 // |pseudo_low_entropy_source|.
18 class EntropyStateProvider : public MetricsProvider {
19  public:
20   explicit EntropyStateProvider(PrefService* local_state);
21   ~EntropyStateProvider() override;
22 
23   EntropyStateProvider(const EntropyStateProvider&) = delete;
24   EntropyStateProvider& operator=(const EntropyStateProvider&) = delete;
25 
26   // Provides low entropy sources values to system profile in the client's
27   // report. This function always provides the same low entropy source values
28   // that are used for randomizing field trials throughout the session.
29   void ProvideSystemProfileMetrics(
30       SystemProfileProto* system_profile_proto) override;
31 
32  private:
33   EntropyState entropy_state_;
34 };
35 
36 }  // namespace metrics
37 
38 #endif  // COMPONENTS_METRICS_ENTROPY_STATE_PROVIDER_H_
39