Index: components/ssl_errors/error_classification.h |
diff --git a/components/ssl_errors/error_classification.h b/components/ssl_errors/error_classification.h |
index 9bcaeae0475580a0c67e7198b002b1d8a4c16f10..7da66fdd6cf5cd2070f7bc576fbb52bfd9373e4a 100644 |
--- a/components/ssl_errors/error_classification.h |
+++ b/components/ssl_errors/error_classification.h |
@@ -46,6 +46,41 @@ enum ClockState { |
CLOCK_STATE_MAX, |
}; |
+// Describes the result of getting network time and if it was |
+// unavailable, why it was unavailable. This enum is being histogrammed |
+// so do not reorder or remove values. |
+// |
+// Exposed for testing. |
+enum NetworkClockState { |
+ // Value 0 was NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC, which is obsolete |
+ // in favor of the finer-grained values below. |
+ |
+ // The clock state relative to network time is unknown because the |
+ // user's clock has fallen out of sync with the latest information |
+ // from the network (due to e.g. suspend/resume). |
+ NETWORK_CLOCK_STATE_UNKNOWN_SYNC_LOST = 1, |
+ // The clock is "close enough" to the network time. |
+ NETWORK_CLOCK_STATE_OK, |
+ // The clock is in the past relative to network time. |
+ NETWORK_CLOCK_STATE_CLOCK_IN_PAST, |
+ // The clock is in the future relative to network time. |
+ NETWORK_CLOCK_STATE_CLOCK_IN_FUTURE, |
+ // The clock state relative to network time is unknown because no sync |
+ // attempt has been made yet. |
+ NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC_ATTEMPT, |
+ // The clock state relative to network time is unknown because one or |
+ // more sync attempts has failed. |
+ NETWORK_CLOCK_STATE_UNKNOWN_NO_SUCCESSFUL_SYNC, |
+ // The clock state relative to network time is unknown because the |
+ // first sync attempt is still pending. |
+ NETWORK_CLOCK_STATE_UNKNOWN_FIRST_SYNC_PENDING, |
+ // The clock state relative to network time is unknown because one or |
+ // more time query attempts have failed, and a subsequent sync attempt |
+ // is still pending. |
+ NETWORK_CLOCK_STATE_UNKNOWN_SUBSEQUENT_SYNC_PENDING, |
+ NETWORK_CLOCK_STATE_MAX |
+}; |
+ |
// Compares |now_system| to the build time and to the current network time, and |
// returns an inference about the state of the system clock. A result from |
// network time, if available, will always be preferred to a result from the |