Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: components/ssl_errors/error_classification.h

Issue 2421143002: Fix broken clockstate.network2 histogram and add unit test (Closed)
Patch Set: meacer suggestion: move field trial into test util Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ssl_errors/BUILD.gn ('k') | components/ssl_errors/error_classification.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « components/ssl_errors/BUILD.gn ('k') | components/ssl_errors/error_classification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698