https_only_mode_metrics.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2022 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. #ifndef COMPONENTS_SECURITY_INTERSTITIALS_CORE_HTTPS_ONLY_MODE_METRICS_H_
  5. #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_HTTPS_ONLY_MODE_METRICS_H_
  6. namespace security_interstitials {
  7. namespace https_only_mode {
  8. extern const char kEventHistogram[];
  9. // These values are persisted to logs. Entries should not be renumbered and
  10. // numeric values should never be reused.
  11. enum class Event {
  12. // Navigation was upgraded from HTTP to HTTPS at some point (either the
  13. // initial request or after a redirect).
  14. kUpgradeAttempted = 0,
  15. // Navigation succeeded after being upgraded to HTTPS.
  16. kUpgradeSucceeded = 1,
  17. // Navigation failed after being upgraded to HTTPS.
  18. kUpgradeFailed = 2,
  19. // kUpgradeCertError, kUpgradeNetError, and kUpgradeTimedOut are subsets of
  20. // kUpgradeFailed. kUpgradeFailed should also be recorded whenever these
  21. // events are recorded.
  22. // Navigation failed due to a cert error.
  23. kUpgradeCertError = 3,
  24. // Navigation failed due to a net error.
  25. kUpgradeNetError = 4,
  26. // Navigation failed due to timing out.
  27. kUpgradeTimedOut = 5,
  28. kMaxValue = kUpgradeTimedOut,
  29. };
  30. } // namespace https_only_mode
  31. } // namespace security_interstitials
  32. #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_HTTPS_ONLY_MODE_METRICS_H_