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

Side by Side Diff: net/ssl/ssl_connection_status_flags.h

Issue 941743002: Add a dedicated SSL protocol version metric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: isherman comments Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ 5 #ifndef NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
6 #define NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ 6 #define NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 // The next three bits are reserved for the SSL version. 31 // The next three bits are reserved for the SSL version.
32 SSL_CONNECTION_VERSION_SHIFT = 20, 32 SSL_CONNECTION_VERSION_SHIFT = 20,
33 SSL_CONNECTION_VERSION_MASK = 7, 33 SSL_CONNECTION_VERSION_MASK = 7,
34 34
35 // 1 << 31 (the sign bit) is reserved so that the SSL connection status will 35 // 1 << 31 (the sign bit) is reserved so that the SSL connection status will
36 // never be negative. 36 // never be negative.
37 }; 37 };
38 38
39 // NOTE: the SSL version enum constants must be between 0 and 39 // NOTE: the SSL version enum constants must be between 0 and
40 // SSL_CONNECTION_VERSION_MASK, inclusive. 40 // SSL_CONNECTION_VERSION_MASK, inclusive. These values are persisted to disk
41 // and used in UMA, so they must remain stable.
41 enum { 42 enum {
42 SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version. 43 SSL_CONNECTION_VERSION_UNKNOWN = 0, // Unknown SSL version.
43 SSL_CONNECTION_VERSION_SSL2 = 1, 44 SSL_CONNECTION_VERSION_SSL2 = 1,
44 SSL_CONNECTION_VERSION_SSL3 = 2, 45 SSL_CONNECTION_VERSION_SSL3 = 2,
45 SSL_CONNECTION_VERSION_TLS1 = 3, 46 SSL_CONNECTION_VERSION_TLS1 = 3,
46 SSL_CONNECTION_VERSION_TLS1_1 = 4, 47 SSL_CONNECTION_VERSION_TLS1_1 = 4,
47 SSL_CONNECTION_VERSION_TLS1_2 = 5, 48 SSL_CONNECTION_VERSION_TLS1_2 = 5,
48 // Reserve 6 for TLS 1.3. 49 // Reserve 6 for TLS 1.3.
49 SSL_CONNECTION_VERSION_QUIC = 7, 50 SSL_CONNECTION_VERSION_QUIC = 7,
50 SSL_CONNECTION_VERSION_MAX, 51 SSL_CONNECTION_VERSION_MAX,
(...skipping 26 matching lines...) Expand all
77 *connection_status &= 78 *connection_status &=
78 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT); 79 ~(SSL_CONNECTION_VERSION_MASK << SSL_CONNECTION_VERSION_SHIFT);
79 // Set the new version. 80 // Set the new version.
80 *connection_status |= 81 *connection_status |=
81 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT); 82 ((version & SSL_CONNECTION_VERSION_MASK) << SSL_CONNECTION_VERSION_SHIFT);
82 } 83 }
83 84
84 } // namespace net 85 } // namespace net
85 86
86 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_ 87 #endif // NET_SSL_SSL_CONNECTION_STATUS_FLAGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698