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

Unified Diff: net/base/ssl_connection_status_flags.h

Issue 4211006: A follow-up of r64178.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Upload before checkin Created 10 years, 1 month 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 | « no previous file | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/ssl_connection_status_flags.h
===================================================================
--- net/base/ssl_connection_status_flags.h (revision 64813)
+++ net/base/ssl_connection_status_flags.h (working copy)
@@ -30,16 +30,24 @@
// The next three bits are reserved for the SSL version.
SSL_CONNECTION_VERSION_SHIFT = 20,
SSL_CONNECTION_VERSION_MASK = 7,
- SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version or SSL not used.
+
+ // 1 << 31 (the sign bit) is reserved so that the SSL connection status will
+ // never be negative.
+};
+
+// NOTE: the SSL version enum constants must be between 0 and
+// SSL_CONNECTION_VERSION_MASK, inclusive.
+enum {
+ SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version.
SSL_CONNECTION_VERSION_SSL2 = 1,
SSL_CONNECTION_VERSION_SSL3 = 2,
SSL_CONNECTION_VERSION_TLS1 = 3,
SSL_CONNECTION_VERSION_TLS1_1 = 4,
SSL_CONNECTION_VERSION_TLS1_2 = 5,
-
- // 1 << 31 (the sign bit) is reserved so that the SSL connection status will
- // never be negative.
+ SSL_CONNECTION_VERSION_MAX,
};
+COMPILE_ASSERT(SSL_CONNECTION_VERSION_MAX - 1 <= SSL_CONNECTION_VERSION_MASK,
+ SSL_CONNECTION_VERSION_MASK_too_small);
inline int SSLConnectionStatusToCipherSuite(int connection_status) {
return (connection_status >> SSL_CONNECTION_CIPHERSUITE_SHIFT) &
« no previous file with comments | « no previous file | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698