| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 int TryCreateStream(StreamRequest* request, | 95 int TryCreateStream(StreamRequest* request, |
| 96 QuicReliableClientStream** stream); | 96 QuicReliableClientStream** stream); |
| 97 | 97 |
| 98 // Cancels the pending stream creation request. | 98 // Cancels the pending stream creation request. |
| 99 void CancelRequest(StreamRequest* request); | 99 void CancelRequest(StreamRequest* request); |
| 100 | 100 |
| 101 // QuicSession methods: | 101 // QuicSession methods: |
| 102 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; | 102 virtual QuicReliableClientStream* CreateOutgoingReliableStream() OVERRIDE; |
| 103 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; | 103 virtual QuicCryptoClientStream* GetCryptoStream() OVERRIDE; |
| 104 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; | 104 virtual void CloseStream(QuicStreamId stream_id) OVERRIDE; |
| 105 virtual void SendRstStream(QuicStreamId id, |
| 106 QuicRstStreamErrorCode error) OVERRIDE; |
| 105 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; | 107 virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE; |
| 106 virtual void OnCryptoHandshakeMessageSent( | 108 virtual void OnCryptoHandshakeMessageSent( |
| 107 const CryptoHandshakeMessage& message) OVERRIDE; | 109 const CryptoHandshakeMessage& message) OVERRIDE; |
| 108 virtual void OnCryptoHandshakeMessageReceived( | 110 virtual void OnCryptoHandshakeMessageReceived( |
| 109 const CryptoHandshakeMessage& message) OVERRIDE; | 111 const CryptoHandshakeMessage& message) OVERRIDE; |
| 110 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 112 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| 111 | 113 |
| 112 // QuicConnectionVisitorInterface methods: | 114 // QuicConnectionVisitorInterface methods: |
| 113 virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE; | 115 virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE; |
| 114 | 116 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 137 | 139 |
| 138 private: | 140 private: |
| 139 friend class test::QuicClientSessionPeer; | 141 friend class test::QuicClientSessionPeer; |
| 140 | 142 |
| 141 typedef std::list<StreamRequest*> StreamRequestQueue; | 143 typedef std::list<StreamRequest*> StreamRequestQueue; |
| 142 | 144 |
| 143 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); | 145 QuicReliableClientStream* CreateOutgoingReliableStreamImpl(); |
| 144 // A completion callback invoked when a read completes. | 146 // A completion callback invoked when a read completes. |
| 145 void OnReadComplete(int result); | 147 void OnReadComplete(int result); |
| 146 | 148 |
| 149 void OnClosedStream(); |
| 150 |
| 147 void CloseSessionOnErrorInner(int error); | 151 void CloseSessionOnErrorInner(int error); |
| 148 | 152 |
| 149 // Posts a task to notify the factory that this session has been closed. | 153 // Posts a task to notify the factory that this session has been closed. |
| 150 void NotifyFactoryOfSessionCloseLater(); | 154 void NotifyFactoryOfSessionCloseLater(); |
| 151 | 155 |
| 152 // Notifies the factory that this session has been closed which will | 156 // Notifies the factory that this session has been closed which will |
| 153 // delete |this|. | 157 // delete |this|. |
| 154 void NotifyFactoryOfSessionClose(); | 158 void NotifyFactoryOfSessionClose(); |
| 155 | 159 |
| 156 bool require_confirmation_; | 160 bool require_confirmation_; |
| 157 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 161 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
| 158 QuicStreamFactory* stream_factory_; | 162 QuicStreamFactory* stream_factory_; |
| 159 scoped_ptr<DatagramClientSocket> socket_; | 163 scoped_ptr<DatagramClientSocket> socket_; |
| 160 scoped_refptr<IOBufferWithSize> read_buffer_; | 164 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 161 StreamRequestQueue stream_requests_; | 165 StreamRequestQueue stream_requests_; |
| 162 bool read_pending_; | 166 bool read_pending_; |
| 163 CompletionCallback callback_; | 167 CompletionCallback callback_; |
| 164 size_t num_total_streams_; | 168 size_t num_total_streams_; |
| 165 BoundNetLog net_log_; | 169 BoundNetLog net_log_; |
| 166 QuicConnectionLogger logger_; | 170 QuicConnectionLogger logger_; |
| 167 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 171 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
| 168 | 172 |
| 169 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 173 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 170 }; | 174 }; |
| 171 | 175 |
| 172 } // namespace net | 176 } // namespace net |
| 173 | 177 |
| 174 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 178 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |