| 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 // A client specific QuicSession subclass. This class owns the underlying | 5 // A client specific QuicSession subclass. This class owns the underlying |
| 6 // QuicConnection and QuicConnectionHelper objects. The connection stores | 6 // QuicConnection and QuicConnectionHelper objects. The connection stores |
| 7 // a non-owning pointer to the helper so this session needs to ensure that | 7 // a non-owning pointer to the helper so this session needs to ensure that |
| 8 // the helper outlives the connection. | 8 // the helper outlives the connection. |
| 9 | 9 |
| 10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // TODO(rch): remove |stream| from this and use setter on |request| | 117 // TODO(rch): remove |stream| from this and use setter on |request| |
| 118 // and fix in spdy too. | 118 // and fix in spdy too. |
| 119 int TryCreateStream(StreamRequest* request, | 119 int TryCreateStream(StreamRequest* request, |
| 120 QuicReliableClientStream** stream); | 120 QuicReliableClientStream** stream); |
| 121 | 121 |
| 122 // Cancels the pending stream creation request. | 122 // Cancels the pending stream creation request. |
| 123 void CancelRequest(StreamRequest* request); | 123 void CancelRequest(StreamRequest* request); |
| 124 | 124 |
| 125 // QuicSession methods: | 125 // QuicSession methods: |
| 126 virtual void OnStreamFrames( | 126 virtual void OnStreamFrames( |
| 127 const std::vector<QuicStreamFrame>& frames) OVERRIDE; | 127 const std::vector<QuicStreamFrame>& frames) override; |
| 128 virtual QuicReliableClientStream* CreateOutgoingDataStream() OVERRIDE; | 128 virtual QuicReliableClientStream* CreateOutgoingDataStream() override; |
| 129 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; | 129 virtual QuicCryptoClientStream* GetCryptoStream() override; |
| 130 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; | 130 virtual void CloseStream(QuicStreamId stream_id) override; |
| 131 virtual void SendRstStream(QuicStreamId id, | 131 virtual void SendRstStream(QuicStreamId id, |
| 132 QuicRstStreamErrorCode error, | 132 QuicRstStreamErrorCode error, |
| 133 QuicStreamOffset bytes_written) OVERRIDE; | 133 QuicStreamOffset bytes_written) override; |
| 134 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; | 134 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; |
| 135 virtual void OnCryptoHandshakeMessageSent( | 135 virtual void OnCryptoHandshakeMessageSent( |
| 136 const CryptoHandshakeMessage& message) OVERRIDE; | 136 const CryptoHandshakeMessage& message) override; |
| 137 virtual void OnCryptoHandshakeMessageReceived( | 137 virtual void OnCryptoHandshakeMessageReceived( |
| 138 const CryptoHandshakeMessage& message) OVERRIDE; | 138 const CryptoHandshakeMessage& message) override; |
| 139 virtual bool GetSSLInfo(SSLInfo* ssl_info) const OVERRIDE; | 139 virtual bool GetSSLInfo(SSLInfo* ssl_info) const override; |
| 140 | 140 |
| 141 // QuicClientSessionBase methods: | 141 // QuicClientSessionBase methods: |
| 142 virtual void OnProofValid( | 142 virtual void OnProofValid( |
| 143 const QuicCryptoClientConfig::CachedState& cached) OVERRIDE; | 143 const QuicCryptoClientConfig::CachedState& cached) override; |
| 144 virtual void OnProofVerifyDetailsAvailable( | 144 virtual void OnProofVerifyDetailsAvailable( |
| 145 const ProofVerifyDetails& verify_details) OVERRIDE; | 145 const ProofVerifyDetails& verify_details) override; |
| 146 | 146 |
| 147 // QuicConnectionVisitorInterface methods: | 147 // QuicConnectionVisitorInterface methods: |
| 148 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE; | 148 virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) override; |
| 149 virtual void OnSuccessfulVersionNegotiation( | 149 virtual void OnSuccessfulVersionNegotiation( |
| 150 const QuicVersion& version) OVERRIDE; | 150 const QuicVersion& version) override; |
| 151 | 151 |
| 152 // Performs a crypto handshake with the server. | 152 // Performs a crypto handshake with the server. |
| 153 int CryptoConnect(bool require_confirmation, | 153 int CryptoConnect(bool require_confirmation, |
| 154 const CompletionCallback& callback); | 154 const CompletionCallback& callback); |
| 155 | 155 |
| 156 // Resumes a crypto handshake with the server after a timeout. | 156 // Resumes a crypto handshake with the server after a timeout. |
| 157 int ResumeCryptoConnect(const CompletionCallback& callback); | 157 int ResumeCryptoConnect(const CompletionCallback& callback); |
| 158 | 158 |
| 159 // Causes the QuicConnectionHelper to start reading from the socket | 159 // Causes the QuicConnectionHelper to start reading from the socket |
| 160 // and passing the data along to the QuicConnection. | 160 // and passing the data along to the QuicConnection. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 175 // than the number of round-trips needed for the handshake. | 175 // than the number of round-trips needed for the handshake. |
| 176 int GetNumSentClientHellos() const; | 176 int GetNumSentClientHellos() const; |
| 177 | 177 |
| 178 // Returns true if |hostname| may be pooled onto this session. If this | 178 // Returns true if |hostname| may be pooled onto this session. If this |
| 179 // is a secure QUIC session, then |hostname| must match the certificate | 179 // is a secure QUIC session, then |hostname| must match the certificate |
| 180 // presented during the handshake. | 180 // presented during the handshake. |
| 181 bool CanPool(const std::string& hostname) const; | 181 bool CanPool(const std::string& hostname) const; |
| 182 | 182 |
| 183 protected: | 183 protected: |
| 184 // QuicSession methods: | 184 // QuicSession methods: |
| 185 virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE; | 185 virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; |
| 186 | 186 |
| 187 private: | 187 private: |
| 188 friend class test::QuicClientSessionPeer; | 188 friend class test::QuicClientSessionPeer; |
| 189 | 189 |
| 190 typedef std::set<Observer*> ObserverSet; | 190 typedef std::set<Observer*> ObserverSet; |
| 191 typedef std::list<StreamRequest*> StreamRequestQueue; | 191 typedef std::list<StreamRequest*> StreamRequestQueue; |
| 192 | 192 |
| 193 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); | 193 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); |
| 194 // A completion callback invoked when a read completes. | 194 // A completion callback invoked when a read completes. |
| 195 void OnReadComplete(int result); | 195 void OnReadComplete(int result); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // on this session. Existing stream will continue to be processed. | 247 // on this session. Existing stream will continue to be processed. |
| 248 bool going_away_; | 248 bool going_away_; |
| 249 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 249 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
| 250 | 250 |
| 251 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 251 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 } // namespace net | 254 } // namespace net |
| 255 | 255 |
| 256 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 256 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |