| OLD | NEW | 
|---|
| 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_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 
| 6 #define NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 6 #define NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 | 9 | 
| 10 #include "net/quic/crypto/crypto_handshake.h" | 10 #include "net/quic/crypto/crypto_handshake.h" | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 31  public: | 31  public: | 
| 32   explicit ServerHelloNotifier(QuicCryptoServerStream* stream) | 32   explicit ServerHelloNotifier(QuicCryptoServerStream* stream) | 
| 33       : server_stream_(stream) {} | 33       : server_stream_(stream) {} | 
| 34 | 34 | 
| 35   // QuicAckNotifier::DelegateInterface implementation | 35   // QuicAckNotifier::DelegateInterface implementation | 
| 36   virtual void OnAckNotification( | 36   virtual void OnAckNotification( | 
| 37       int num_original_packets, | 37       int num_original_packets, | 
| 38       int num_original_bytes, | 38       int num_original_bytes, | 
| 39       int num_retransmitted_packets, | 39       int num_retransmitted_packets, | 
| 40       int num_retransmitted_bytes, | 40       int num_retransmitted_bytes, | 
| 41       QuicTime::Delta delta_largest_observed) OVERRIDE; | 41       QuicTime::Delta delta_largest_observed) override; | 
| 42 | 42 | 
| 43  private: | 43  private: | 
| 44   virtual ~ServerHelloNotifier() {} | 44   virtual ~ServerHelloNotifier() {} | 
| 45 | 45 | 
| 46   QuicCryptoServerStream* server_stream_; | 46   QuicCryptoServerStream* server_stream_; | 
| 47 | 47 | 
| 48   DISALLOW_COPY_AND_ASSIGN(ServerHelloNotifier); | 48   DISALLOW_COPY_AND_ASSIGN(ServerHelloNotifier); | 
| 49 }; | 49 }; | 
| 50 | 50 | 
| 51 class NET_EXPORT_PRIVATE QuicCryptoServerStream : public QuicCryptoStream { | 51 class NET_EXPORT_PRIVATE QuicCryptoServerStream : public QuicCryptoStream { | 
| 52  public: | 52  public: | 
| 53   QuicCryptoServerStream(const QuicCryptoServerConfig& crypto_config, | 53   QuicCryptoServerStream(const QuicCryptoServerConfig& crypto_config, | 
| 54                          QuicSession* session); | 54                          QuicSession* session); | 
| 55   virtual ~QuicCryptoServerStream(); | 55   virtual ~QuicCryptoServerStream(); | 
| 56 | 56 | 
| 57   // Cancel any outstanding callbacks, such as asynchronous validation of client | 57   // Cancel any outstanding callbacks, such as asynchronous validation of client | 
| 58   // hello. | 58   // hello. | 
| 59   void CancelOutstandingCallbacks(); | 59   void CancelOutstandingCallbacks(); | 
| 60 | 60 | 
| 61   // CryptoFramerVisitorInterface implementation | 61   // CryptoFramerVisitorInterface implementation | 
| 62   virtual void OnHandshakeMessage( | 62   virtual void OnHandshakeMessage( | 
| 63       const CryptoHandshakeMessage& message) OVERRIDE; | 63       const CryptoHandshakeMessage& message) override; | 
| 64 | 64 | 
| 65   // GetBase64SHA256ClientChannelID sets |*output| to the base64 encoded, | 65   // GetBase64SHA256ClientChannelID sets |*output| to the base64 encoded, | 
| 66   // SHA-256 hash of the client's ChannelID key and returns true, if the client | 66   // SHA-256 hash of the client's ChannelID key and returns true, if the client | 
| 67   // presented a ChannelID. Otherwise it returns false. | 67   // presented a ChannelID. Otherwise it returns false. | 
| 68   bool GetBase64SHA256ClientChannelID(std::string* output) const; | 68   bool GetBase64SHA256ClientChannelID(std::string* output) const; | 
| 69 | 69 | 
| 70   uint8 num_handshake_messages() const { return num_handshake_messages_; } | 70   uint8 num_handshake_messages() const { return num_handshake_messages_; } | 
| 71 | 71 | 
| 72   int num_server_config_update_messages_sent() const { | 72   int num_server_config_update_messages_sent() const { | 
| 73     return num_server_config_update_messages_sent_; | 73     return num_server_config_update_messages_sent_; | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 96   friend class test::CryptoTestUtils; | 96   friend class test::CryptoTestUtils; | 
| 97 | 97 | 
| 98   class ValidateCallback : public ValidateClientHelloResultCallback { | 98   class ValidateCallback : public ValidateClientHelloResultCallback { | 
| 99    public: | 99    public: | 
| 100     explicit ValidateCallback(QuicCryptoServerStream* parent); | 100     explicit ValidateCallback(QuicCryptoServerStream* parent); | 
| 101     // To allow the parent to detach itself from the callback before deletion. | 101     // To allow the parent to detach itself from the callback before deletion. | 
| 102     void Cancel(); | 102     void Cancel(); | 
| 103 | 103 | 
| 104     // From ValidateClientHelloResultCallback | 104     // From ValidateClientHelloResultCallback | 
| 105     virtual void RunImpl(const CryptoHandshakeMessage& client_hello, | 105     virtual void RunImpl(const CryptoHandshakeMessage& client_hello, | 
| 106                          const Result& result) OVERRIDE; | 106                          const Result& result) override; | 
| 107 | 107 | 
| 108    private: | 108    private: | 
| 109     QuicCryptoServerStream* parent_; | 109     QuicCryptoServerStream* parent_; | 
| 110 | 110 | 
| 111     DISALLOW_COPY_AND_ASSIGN(ValidateCallback); | 111     DISALLOW_COPY_AND_ASSIGN(ValidateCallback); | 
| 112   }; | 112   }; | 
| 113 | 113 | 
| 114   // Invoked by ValidateCallback::RunImpl once initial validation of | 114   // Invoked by ValidateCallback::RunImpl once initial validation of | 
| 115   // the client hello is complete.  Finishes processing of the client | 115   // the client hello is complete.  Finishes processing of the client | 
| 116   // hello message and handles handshake success/failure. | 116   // hello message and handles handshake success/failure. | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 132 | 132 | 
| 133   // Number of server config update (SCUP) messages sent by this stream. | 133   // Number of server config update (SCUP) messages sent by this stream. | 
| 134   int num_server_config_update_messages_sent_; | 134   int num_server_config_update_messages_sent_; | 
| 135 | 135 | 
| 136   DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); | 136   DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream); | 
| 137 }; | 137 }; | 
| 138 | 138 | 
| 139 }  // namespace net | 139 }  // namespace net | 
| 140 | 140 | 
| 141 #endif  // NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 141 #endif  // NET_QUIC_QUIC_CRYPTO_SERVER_STREAM_H_ | 
| OLD | NEW | 
|---|