Alexei Svitkine | e726dd52 | 2018-03-09 04:41:03 | [diff] [blame] | 1 | // Copyright 2018 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. |
| 4 | |
| 5 | #ifndef COMPONENTS_VARIATIONS_VARIATIONS_CRASH_KEYS_H_ |
| 6 | #define COMPONENTS_VARIATIONS_VARIATIONS_CRASH_KEYS_H_ |
| 7 | |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace variations { |
| 11 | |
| 12 | struct SyntheticTrialGroup; |
| 13 | |
| 14 | // Initializes crash keys that report the current set of active FieldTrial |
| 15 | // groups (aka variations) for crash reports. After initialization, an observer |
| 16 | // will be registered on FieldTrialList that will keep the crash keys up-to-date |
| 17 | // with newly-activated trials. Synthetic trials must be manually updated using |
| 18 | // the API below. |
| 19 | void InitCrashKeys(); |
| 20 | |
| 21 | // Updates variations crash keys by replacing the list of synthetic trials with |
| 22 | // the specified list. Does not affect non-synthetic trials. |
| 23 | void UpdateCrashKeysWithSyntheticTrials( |
| 24 | const std::vector<SyntheticTrialGroup>& synthetic_trials); |
| 25 | |
| 26 | // Clears the internal instance, for testing. |
| 27 | void ClearCrashKeysInstanceForTesting(); |
| 28 | |
| 29 | } // namespace variations |
| 30 | |
| 31 | #endif // COMPONENTS_VARIATIONS_VARIATIONS_CRASH_KEYS_H_ |