| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // and fix in spdy too. | 107 // and fix in spdy too. |
| 108 int TryCreateStream(StreamRequest* request, | 108 int TryCreateStream(StreamRequest* request, |
| 109 QuicReliableClientStream** stream); | 109 QuicReliableClientStream** stream); |
| 110 | 110 |
| 111 // Cancels the pending stream creation request. | 111 // Cancels the pending stream creation request. |
| 112 void CancelRequest(StreamRequest* request); | 112 void CancelRequest(StreamRequest* request); |
| 113 | 113 |
| 114 // QuicSession methods: | 114 // QuicSession methods: |
| 115 virtual bool OnStreamFrames( | 115 virtual bool OnStreamFrames( |
| 116 const std::vector<QuicStreamFrame>& frames) OVERRIDE; | 116 const std::vector<QuicStreamFrame>& frames) OVERRIDE; |
| 117 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; | 117 virtual QuicReliableClientStream* CreateOutgoingDataStream() OVERRIDE; |
| 118 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; | 118 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; |
| 119 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; | 119 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; |
| 120 virtual void SendRstStream(QuicStreamId id, | 120 virtual void SendRstStream(QuicStreamId id, |
| 121 QuicRstStreamErrorCode error) OVERRIDE; | 121 QuicRstStreamErrorCode error) OVERRIDE; |
| 122 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; | 122 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; |
| 123 virtual void OnCryptoHandshakeMessageSent( | 123 virtual void OnCryptoHandshakeMessageSent( |
| 124 const CryptoHandshakeMessage& message) OVERRIDE; | 124 const CryptoHandshakeMessage& message) OVERRIDE; |
| 125 virtual void OnCryptoHandshakeMessageReceived( | 125 virtual void OnCryptoHandshakeMessageReceived( |
| 126 const CryptoHandshakeMessage& message) OVERRIDE; | 126 const CryptoHandshakeMessage& message) OVERRIDE; |
| 127 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 127 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 149 | 149 |
| 150 base::WeakPtr<QuicClientSession> GetWeakPtr(); | 150 base::WeakPtr<QuicClientSession> GetWeakPtr(); |
| 151 | 151 |
| 152 // Returns the number of client hello messages that have been sent on the | 152 // Returns the number of client hello messages that have been sent on the |
| 153 // crypto stream. If the handshake has completed then this is one greater | 153 // crypto stream. If the handshake has completed then this is one greater |
| 154 // than the number of round-trips needed for the handshake. | 154 // than the number of round-trips needed for the handshake. |
| 155 int GetNumSentClientHellos() const; | 155 int GetNumSentClientHellos() const; |
| 156 | 156 |
| 157 protected: | 157 protected: |
| 158 // QuicSession methods: | 158 // QuicSession methods: |
| 159 virtual ReliableQuicStream* CreateIncomingReliableStream( | 159 virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE; |
| 160 QuicStreamId id) OVERRIDE; | |
| 161 | 160 |
| 162 private: | 161 private: |
| 163 friend class test::QuicClientSessionPeer; | 162 friend class test::QuicClientSessionPeer; |
| 164 | 163 |
| 165 typedef std::set<Observer*> ObserverSet; | 164 typedef std::set<Observer*> ObserverSet; |
| 166 typedef std::list<StreamRequest*> StreamRequestQueue; | 165 typedef std::list<StreamRequest*> StreamRequestQueue; |
| 167 | 166 |
| 168 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); | 167 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); |
| 169 // A completion callback invoked when a read completes. | 168 // A completion callback invoked when a read completes. |
| 170 void OnReadComplete(int result); | 169 void OnReadComplete(int result); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // Number of packets read in the current read loop. | 210 // Number of packets read in the current read loop. |
| 212 size_t num_packets_read_; | 211 size_t num_packets_read_; |
| 213 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 212 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
| 214 | 213 |
| 215 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 214 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 216 }; | 215 }; |
| 217 | 216 |
| 218 } // namespace net | 217 } // namespace net |
| 219 | 218 |
| 220 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 219 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |