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

Unified Diff: net/ssl/ssl_connection_status_flags.h

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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 | « net/quic/chromium/quic_connection_logger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_connection_status_flags.h
diff --git a/net/ssl/ssl_connection_status_flags.h b/net/ssl/ssl_connection_status_flags.h
index ce6bc55d88a0189b26a0a63e5e48a120aa873c1e..cd3ad50cb87fe1b497f8b29f81cbd7f2865dfc06 100644
--- a/net/ssl/ssl_connection_status_flags.h
+++ b/net/ssl/ssl_connection_status_flags.h
@@ -35,7 +35,7 @@ enum {
// NOTE: the SSL version enum constants must be between 0 and
// SSL_CONNECTION_VERSION_MASK, inclusive. These values are persisted to disk
// and used in UMA, so they must remain stable.
-enum {
+enum SSLVersion {
SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version.
SSL_CONNECTION_VERSION_SSL2 = 1,
SSL_CONNECTION_VERSION_SSL3 = 2,
@@ -53,9 +53,10 @@ inline uint16_t SSLConnectionStatusToCipherSuite(int connection_status) {
return static_cast<uint16_t>(connection_status);
}
-inline int SSLConnectionStatusToVersion(int connection_status) {
- return (connection_status >> SSL_CONNECTION_VERSION_SHIFT) &
- SSL_CONNECTION_VERSION_MASK;
+inline SSLVersion SSLConnectionStatusToVersion(int connection_status) {
+ return static_cast<SSLVersion>(
+ (connection_status >> SSL_CONNECTION_VERSION_SHIFT) &
+ SSL_CONNECTION_VERSION_MASK);
}
inline void SSLConnectionStatusSetCipherSuite(uint16_t cipher_suite,
« no previous file with comments | « net/quic/chromium/quic_connection_logger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698