1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_
6 #define IOS_CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_
10 #include "base/macros.h"
11 #include "base/metrics/field_trial.h"
15 // FieldTrialSynchronizer registers itself as an observer of FieldTrialList
16 // and update the list of experiment reported to in the crashes by setting
17 // the corresponding crash key.
18 class FieldTrialSynchronizer
: public base::FieldTrialList::Observer
{
20 FieldTrialSynchronizer();
21 ~FieldTrialSynchronizer() override
;
24 // base::FieldTrialList::Observer implementation.
25 void OnFieldTrialGroupFinalized(const std::string
& field_trial_name
,
26 const std::string
& group_name
) override
;
28 // Synchronizes the list of experiments into the crash keys. Called on
29 // creation and when the list of field trial changes.
30 void SynchronizeCrashKeyExperimentList();
32 DISALLOW_COPY_AND_ASSIGN(FieldTrialSynchronizer
);
37 #endif // IOS_CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_