xref: /aosp_15_r20/external/cronet/components/metrics/entropy_state_provider.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1*6777b538SAndroid Build Coastguard Worker // Copyright 2020 The Chromium Authors
2*6777b538SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*6777b538SAndroid Build Coastguard Worker // found in the LICENSE file.
4*6777b538SAndroid Build Coastguard Worker 
5*6777b538SAndroid Build Coastguard Worker #include "components/metrics/entropy_state_provider.h"
6*6777b538SAndroid Build Coastguard Worker 
7*6777b538SAndroid Build Coastguard Worker #include "third_party/metrics_proto/system_profile.pb.h"
8*6777b538SAndroid Build Coastguard Worker 
9*6777b538SAndroid Build Coastguard Worker namespace metrics {
10*6777b538SAndroid Build Coastguard Worker 
EntropyStateProvider(PrefService * local_state)11*6777b538SAndroid Build Coastguard Worker EntropyStateProvider::EntropyStateProvider(PrefService* local_state)
12*6777b538SAndroid Build Coastguard Worker     : entropy_state_(local_state) {}
13*6777b538SAndroid Build Coastguard Worker 
14*6777b538SAndroid Build Coastguard Worker EntropyStateProvider::~EntropyStateProvider() = default;
15*6777b538SAndroid Build Coastguard Worker 
ProvideSystemProfileMetrics(SystemProfileProto * system_profile)16*6777b538SAndroid Build Coastguard Worker void EntropyStateProvider::ProvideSystemProfileMetrics(
17*6777b538SAndroid Build Coastguard Worker     SystemProfileProto* system_profile) {
18*6777b538SAndroid Build Coastguard Worker   system_profile->set_low_entropy_source(entropy_state_.GetLowEntropySource());
19*6777b538SAndroid Build Coastguard Worker   system_profile->set_old_low_entropy_source(
20*6777b538SAndroid Build Coastguard Worker       entropy_state_.GetOldLowEntropySource());
21*6777b538SAndroid Build Coastguard Worker   system_profile->set_pseudo_low_entropy_source(
22*6777b538SAndroid Build Coastguard Worker       entropy_state_.GetPseudoLowEntropySource());
23*6777b538SAndroid Build Coastguard Worker }
24*6777b538SAndroid Build Coastguard Worker 
25*6777b538SAndroid Build Coastguard Worker }  // namespace metrics
26