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

Unified Diff: net/socket/ssl_client_socket.h

Issue 590513002: Add histogram to track NPN/ALPN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | net/socket/ssl_client_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket.h
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index 0e32ed6d39e27cd60e6f928d4a03a7857113c786..8eea20cd0ded6f75b2c56acc14bf2728a8a91a5c 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -79,6 +79,20 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
// the first protocol in our list.
};
+ // TLS extension used to negotiate protocol. Recorded in UMA, do not change
+ // or reuse values.
+ enum SSLProtocolNegotiation {
+ // Unknown.
+ PN_UNKNOWN = -1,
+ // Application-Layer Protocol Negotiation.
+ PN_ALPN = 0,
+ // Next Protocol Negotiation used.
+ PN_NPN = 500,
+ // Next Protocol Negotiation used, but there was no overlap between client
+ // and server supported protocols. Fallback to first one on client's list.
+ PN_NPN_NO_OVERLAP = 1000,
davidben 2014/09/19 21:09:17 It seems strange to have this enum with large numb
Bence 2014/10/03 10:50:22 Done. I changed to kExtension* to better distingu
+ };
+
// StreamSocket:
virtual bool WasNpnNegotiated() const OVERRIDE;
virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
@@ -150,6 +164,9 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
virtual void set_protocol_negotiated(NextProto protocol_negotiated);
+ void set_protocol_negotiation(
+ enum SSLProtocolNegotiation protocol_negotiation);
davidben 2014/09/19 21:09:17 No 'enum' prefix in C++.
Bence 2014/10/03 10:50:22 Done.
+
// Returns the ChannelIDService used by this socket, or NULL if
// channel ids are not supported.
virtual ChannelIDService* GetChannelIDService() const = 0;
@@ -162,6 +179,10 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
// Public for ssl_client_socket_openssl_unittest.cc.
virtual bool WasChannelIDSent() const;
+ // Record which TLS extension was used to negotiate protocol and protocol
+ // chosen in a UMA histogram.
+ void RecordProtocolNegotiation();
+
protected:
virtual void set_channel_id_sent(bool channel_id_sent);
@@ -219,6 +240,8 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
bool signed_cert_timestamps_received_;
// True if a stapled OCSP response was received.
bool stapled_ocsp_response_received_;
+ // Protocol negotiation extension used.
+ enum SSLProtocolNegotiation protocol_negotiation_;
};
} // namespace net
« no previous file with comments | « no previous file | net/socket/ssl_client_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698