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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 // if |session_| is destroyed while the stream request is still pending. | 80 // if |session_| is destroyed while the stream request is still pending. |
81 void OnRequestCompleteFailure(int rv); | 81 void OnRequestCompleteFailure(int rv); |
82 | 82 |
83 base::WeakPtr<QuicClientSession> session_; | 83 base::WeakPtr<QuicClientSession> session_; |
84 CompletionCallback callback_; | 84 CompletionCallback callback_; |
85 QuicReliableClientStream** stream_; | 85 QuicReliableClientStream** stream_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(StreamRequest); | 87 DISALLOW_COPY_AND_ASSIGN(StreamRequest); |
88 }; | 88 }; |
89 | 89 |
90 // Constructs a new session which will own |connection| and |helper|, but | 90 // Constructs a new session connected to |host_port_pair| which will own |
wtc
2014/07/01 23:00:14
host_port_pair => server_host_port
Ryan Hamilton
2014/07/01 23:26:19
Reverted this and just used server_id instead.
| |
91 // not |stream_factory|, which must outlive this session. | 91 // |connection|, but not |stream_factory|, which must outlive this session. |
92 // TODO(rch): decouple the factory from the session via a Delegate interface. | 92 // TODO(rch): decouple the factory from the session via a Delegate interface. |
93 QuicClientSession(QuicConnection* connection, | 93 QuicClientSession(const HostPortPair& server_host_port, |
wtc
2014/07/01 23:00:14
IMPORTANT: the HostPortPair is readily available i
Ryan Hamilton
2014/07/01 23:26:19
Done.
| |
94 QuicConnection* connection, | |
94 scoped_ptr<DatagramClientSocket> socket, | 95 scoped_ptr<DatagramClientSocket> socket, |
95 scoped_ptr<QuicDefaultPacketWriter> writer, | 96 scoped_ptr<QuicDefaultPacketWriter> writer, |
96 QuicStreamFactory* stream_factory, | 97 QuicStreamFactory* stream_factory, |
97 QuicCryptoClientStreamFactory* crypto_client_stream_factory, | 98 QuicCryptoClientStreamFactory* crypto_client_stream_factory, |
98 scoped_ptr<QuicServerInfo> server_info, | 99 scoped_ptr<QuicServerInfo> server_info, |
99 const QuicServerId& server_id, | 100 const QuicServerId& server_id, |
100 const QuicConfig& config, | 101 const QuicConfig& config, |
101 QuicCryptoClientConfig* crypto_config, | 102 QuicCryptoClientConfig* crypto_config, |
102 base::TaskRunner* task_runner, | 103 base::TaskRunner* task_runner, |
103 NetLog* net_log); | 104 NetLog* net_log); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 | 213 |
213 // Posts a task to notify the factory that this session has been closed. | 214 // Posts a task to notify the factory that this session has been closed. |
214 void NotifyFactoryOfSessionClosedLater(); | 215 void NotifyFactoryOfSessionClosedLater(); |
215 | 216 |
216 // Notifies the factory that this session has been closed which will | 217 // Notifies the factory that this session has been closed which will |
217 // delete |this|. | 218 // delete |this|. |
218 void NotifyFactoryOfSessionClosed(); | 219 void NotifyFactoryOfSessionClosed(); |
219 | 220 |
220 void OnConnectTimeout(); | 221 void OnConnectTimeout(); |
221 | 222 |
223 const HostPortPair server_host_port_; | |
222 bool require_confirmation_; | 224 bool require_confirmation_; |
223 scoped_ptr<QuicCryptoClientStream> crypto_stream_; | 225 scoped_ptr<QuicCryptoClientStream> crypto_stream_; |
224 QuicStreamFactory* stream_factory_; | 226 QuicStreamFactory* stream_factory_; |
225 scoped_ptr<DatagramClientSocket> socket_; | 227 scoped_ptr<DatagramClientSocket> socket_; |
226 scoped_ptr<QuicDefaultPacketWriter> writer_; | 228 scoped_ptr<QuicDefaultPacketWriter> writer_; |
227 scoped_refptr<IOBufferWithSize> read_buffer_; | 229 scoped_refptr<IOBufferWithSize> read_buffer_; |
228 scoped_ptr<QuicServerInfo> server_info_; | 230 scoped_ptr<QuicServerInfo> server_info_; |
229 scoped_ptr<CertVerifyResult> cert_verify_result_; | 231 scoped_ptr<CertVerifyResult> cert_verify_result_; |
230 ObserverSet observers_; | 232 ObserverSet observers_; |
231 StreamRequestQueue stream_requests_; | 233 StreamRequestQueue stream_requests_; |
(...skipping 10 matching lines...) Expand all Loading... | |
242 // on this session. Existing stream will continue to be processed. | 244 // on this session. Existing stream will continue to be processed. |
243 bool going_away_; | 245 bool going_away_; |
244 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 246 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
245 | 247 |
246 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 248 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
247 }; | 249 }; |
248 | 250 |
249 } // namespace net | 251 } // namespace net |
250 | 252 |
251 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 253 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
OLD | NEW |