| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 virtual void OnCryptoHandshakeMessageSent( | 106 virtual void OnCryptoHandshakeMessageSent( |
| 107 const CryptoHandshakeMessage& message) OVERRIDE; | 107 const CryptoHandshakeMessage& message) OVERRIDE; |
| 108 virtual void OnCryptoHandshakeMessageReceived( | 108 virtual void OnCryptoHandshakeMessageReceived( |
| 109 const CryptoHandshakeMessage& message) OVERRIDE; | 109 const CryptoHandshakeMessage& message) OVERRIDE; |
| 110 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 110 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| 111 | 111 |
| 112 // QuicConnectionVisitorInterface methods: | 112 // QuicConnectionVisitorInterface methods: |
| 113 virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE; | 113 virtual void ConnectionClose(QuicErrorCode error, bool from_peer) OVERRIDE; |
| 114 | 114 |
| 115 // Performs a crypto handshake with the server. | 115 // Performs a crypto handshake with the server. |
| 116 int CryptoConnect(const CompletionCallback& callback); | 116 int CryptoConnect(bool require_confirmation, |
| 117 const CompletionCallback& callback); |
| 117 | 118 |
| 118 // Causes the QuicConnectionHelper to start reading from the socket | 119 // Causes the QuicConnectionHelper to start reading from the socket |
| 119 // and passing the data along to the QuicConnection. | 120 // and passing the data along to the QuicConnection. |
| 120 void StartReading(); | 121 void StartReading(); |
| 121 | 122 |
| 122 // Close the session because of |error| and notifies the factory | 123 // Close the session because of |error| and notifies the factory |
| 123 // that this session has been closed, which will delete the session. | 124 // that this session has been closed, which will delete the session. |
| 124 void CloseSessionOnError(int error); | 125 void CloseSessionOnError(int error); |
| 125 | 126 |
| 126 base::Value* GetInfoAsValue(const HostPortPair& pair) const; | 127 base::Value* GetInfoAsValue(const HostPortPair& pair) const; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 145 | 146 |
| 146 void CloseSessionOnErrorInner(int error); | 147 void CloseSessionOnErrorInner(int error); |
| 147 | 148 |
| 148 // Posts a task to notify the factory that this session has been closed. | 149 // Posts a task to notify the factory that this session has been closed. |
| 149 void NotifyFactoryOfSessionCloseLater(); | 150 void NotifyFactoryOfSessionCloseLater(); |
| 150 | 151 |
| 151 // Notifies the factory that this session has been closed which will | 152 // Notifies the factory that this session has been closed which will |
| 152 // delete |this|. | 153 // delete |this|. |
| 153 void NotifyFactoryOfSessionClose(); | 154 void NotifyFactoryOfSessionClose(); |
| 154 | 155 |
| 155 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 156 bool require_confirmation_; |
| 156 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 157 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
| 157 QuicStreamFactory* stream_factory_; | 158 QuicStreamFactory* stream_factory_; |
| 158 scoped_ptr<DatagramClientSocket> socket_; | 159 scoped_ptr<DatagramClientSocket> socket_; |
| 159 scoped_refptr<IOBufferWithSize> read_buffer_; | 160 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 160 StreamRequestQueue stream_requests_; | 161 StreamRequestQueue stream_requests_; |
| 161 bool read_pending_; | 162 bool read_pending_; |
| 162 CompletionCallback callback_; | 163 CompletionCallback callback_; |
| 163 size_t num_total_streams_; | 164 size_t num_total_streams_; |
| 164 BoundNetLog net_log_; | 165 BoundNetLog net_log_; |
| 165 QuicConnectionLogger logger_; | 166 QuicConnectionLogger logger_; |
| 167 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
| 166 | 168 |
| 167 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 169 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 } // namespace net | 172 } // namespace net |
| 171 | 173 |
| 172 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 174 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |