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

Unified Diff: net/ssl/ssl_connection_status_flags.h

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/ssl/openssl_platform_key_win.cc ('k') | net/ssl/ssl_connection_status_flags_unittest.cc » ('j') | 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 faae306a5055b69c61db1edd7fb80daa982debb3..e2a8193ba1929bd7fe432a84d40a911e181a5f52 100644
--- a/net/ssl/ssl_connection_status_flags.h
+++ b/net/ssl/ssl_connection_status_flags.h
@@ -13,7 +13,6 @@ namespace net {
// Status flags for SSLInfo::connection_status.
enum {
// The lower 16 bits are reserved for the TLS ciphersuite id.
- SSL_CONNECTION_CIPHERSUITE_SHIFT = 0,
SSL_CONNECTION_CIPHERSUITE_MASK = 0xffff,
// The next two bits are reserved for the compression used.
@@ -53,9 +52,8 @@ enum {
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) &
- SSL_CONNECTION_CIPHERSUITE_MASK;
+inline uint16 SSLConnectionStatusToCipherSuite(int connection_status) {
+ return static_cast<uint16>(connection_status);
}
inline int SSLConnectionStatusToVersion(int connection_status) {
@@ -63,14 +61,12 @@ inline int SSLConnectionStatusToVersion(int connection_status) {
SSL_CONNECTION_VERSION_MASK;
}
-inline void SSLConnectionStatusSetCipherSuite(int cipher_suite,
+inline void SSLConnectionStatusSetCipherSuite(uint16 cipher_suite,
int* connection_status) {
// Clear out the old ciphersuite.
- *connection_status &=
- ~(SSL_CONNECTION_CIPHERSUITE_MASK << SSL_CONNECTION_CIPHERSUITE_SHIFT);
+ *connection_status &= ~SSL_CONNECTION_CIPHERSUITE_MASK;
// Set the new ciphersuite.
- *connection_status |= ((cipher_suite & SSL_CONNECTION_CIPHERSUITE_MASK)
- << SSL_CONNECTION_CIPHERSUITE_SHIFT);
+ *connection_status |= cipher_suite;
}
inline void SSLConnectionStatusSetVersion(int version, int* connection_status) {
« no previous file with comments | « net/ssl/openssl_platform_key_win.cc ('k') | net/ssl/ssl_connection_status_flags_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698