Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / net / socket / ssl_client_socket.h
index 0e32ed6..7adfa8c 100644 (file)
@@ -79,9 +79,16 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
                                 // the first protocol in our list.
   };
 
+  // TLS extension used to negotiate protocol.
+  enum SSLNegotiationExtension {
+    kExtensionUnknown,
+    kExtensionALPN,
+    kExtensionNPN,
+  };
+
   // StreamSocket:
-  virtual bool WasNpnNegotiated() const OVERRIDE;
-  virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
+  bool WasNpnNegotiated() const override;
+  NextProto GetNegotiatedProtocol() const override;
 
   // Computes a unique key string for the SSL session cache.
   virtual std::string GetSessionCacheKey() const = 0;
@@ -150,6 +157,8 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
 
   virtual void set_protocol_negotiated(NextProto protocol_negotiated);
 
+  void set_negotiation_extension(SSLNegotiationExtension negotiation_extension);
+
   // Returns the ChannelIDService used by this socket, or NULL if
   // channel ids are not supported.
   virtual ChannelIDService* GetChannelIDService() const = 0;
@@ -162,6 +171,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 RecordNegotiationExtension();
+
  protected:
   virtual void set_channel_id_sent(bool channel_id_sent);
 
@@ -179,6 +192,9 @@ class NET_EXPORT SSLClientSocket : public SSLSocket {
       bool channel_id_enabled,
       bool supports_ecc);
 
+  // Records ConnectionType histograms for a successful SSL connection.
+  static void RecordConnectionTypeMetrics(int ssl_version);
+
   // Returns whether TLS channel ID is enabled.
   static bool IsChannelIDEnabled(
       const SSLConfig& ssl_config,
@@ -219,6 +235,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.
+  SSLNegotiationExtension negotiation_extension_;
 };
 
 }  // namespace net