Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: net/quic/quic_client_session.h

Issue 467963002: Refactoring: Create per-connection packet writers in QuicDispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Wan-Teh's comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 #include "net/quic/quic_crypto_client_stream.h" 23 #include "net/quic/quic_crypto_client_stream.h"
24 #include "net/quic/quic_protocol.h" 24 #include "net/quic/quic_protocol.h"
25 #include "net/quic/quic_reliable_client_stream.h" 25 #include "net/quic/quic_reliable_client_stream.h"
26 26
27 namespace net { 27 namespace net {
28 28
29 class CertVerifyResult; 29 class CertVerifyResult;
30 class DatagramClientSocket; 30 class DatagramClientSocket;
31 class QuicConnectionHelper; 31 class QuicConnectionHelper;
32 class QuicCryptoClientStreamFactory; 32 class QuicCryptoClientStreamFactory;
33 class QuicDefaultPacketWriter;
34 class QuicServerId; 33 class QuicServerId;
35 class QuicServerInfo; 34 class QuicServerInfo;
36 class QuicStreamFactory; 35 class QuicStreamFactory;
37 class SSLInfo; 36 class SSLInfo;
38 37
39 namespace test { 38 namespace test {
40 class QuicClientSessionPeer; 39 class QuicClientSessionPeer;
41 } // namespace test 40 } // namespace test
42 41
43 class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase { 42 class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 QuicReliableClientStream** stream_; 84 QuicReliableClientStream** stream_;
86 85
87 DISALLOW_COPY_AND_ASSIGN(StreamRequest); 86 DISALLOW_COPY_AND_ASSIGN(StreamRequest);
88 }; 87 };
89 88
90 // Constructs a new session connected to |server_id| which will own 89 // Constructs a new session connected to |server_id| which will own
91 // |connection|, but not |stream_factory|, which must outlive this session. 90 // |connection|, but not |stream_factory|, which must outlive this session.
92 // TODO(rch): decouple the factory from the session via a Delegate interface. 91 // TODO(rch): decouple the factory from the session via a Delegate interface.
93 QuicClientSession(QuicConnection* connection, 92 QuicClientSession(QuicConnection* connection,
94 scoped_ptr<DatagramClientSocket> socket, 93 scoped_ptr<DatagramClientSocket> socket,
95 scoped_ptr<QuicDefaultPacketWriter> writer,
96 QuicStreamFactory* stream_factory, 94 QuicStreamFactory* stream_factory,
97 QuicCryptoClientStreamFactory* crypto_client_stream_factory, 95 QuicCryptoClientStreamFactory* crypto_client_stream_factory,
98 scoped_ptr<QuicServerInfo> server_info, 96 scoped_ptr<QuicServerInfo> server_info,
99 const QuicServerId& server_id, 97 const QuicServerId& server_id,
100 const QuicConfig& config, 98 const QuicConfig& config,
101 QuicCryptoClientConfig* crypto_config, 99 QuicCryptoClientConfig* crypto_config,
102 base::TaskRunner* task_runner, 100 base::TaskRunner* task_runner,
103 NetLog* net_log); 101 NetLog* net_log);
104 virtual ~QuicClientSession(); 102 virtual ~QuicClientSession();
105 103
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // delete |this|. 215 // delete |this|.
218 void NotifyFactoryOfSessionClosed(); 216 void NotifyFactoryOfSessionClosed();
219 217
220 void OnConnectTimeout(); 218 void OnConnectTimeout();
221 219
222 const HostPortPair server_host_port_; 220 const HostPortPair server_host_port_;
223 bool require_confirmation_; 221 bool require_confirmation_;
224 scoped_ptr<QuicCryptoClientStream> crypto_stream_; 222 scoped_ptr<QuicCryptoClientStream> crypto_stream_;
225 QuicStreamFactory* stream_factory_; 223 QuicStreamFactory* stream_factory_;
226 scoped_ptr<DatagramClientSocket> socket_; 224 scoped_ptr<DatagramClientSocket> socket_;
227 scoped_ptr<QuicDefaultPacketWriter> writer_;
228 scoped_refptr<IOBufferWithSize> read_buffer_; 225 scoped_refptr<IOBufferWithSize> read_buffer_;
229 scoped_ptr<QuicServerInfo> server_info_; 226 scoped_ptr<QuicServerInfo> server_info_;
230 scoped_ptr<CertVerifyResult> cert_verify_result_; 227 scoped_ptr<CertVerifyResult> cert_verify_result_;
231 std::string pinning_failure_log_; 228 std::string pinning_failure_log_;
232 ObserverSet observers_; 229 ObserverSet observers_;
233 StreamRequestQueue stream_requests_; 230 StreamRequestQueue stream_requests_;
234 bool read_pending_; 231 bool read_pending_;
235 CompletionCallback callback_; 232 CompletionCallback callback_;
236 size_t num_total_streams_; 233 size_t num_total_streams_;
237 base::TaskRunner* task_runner_; 234 base::TaskRunner* task_runner_;
238 BoundNetLog net_log_; 235 BoundNetLog net_log_;
239 base::TimeTicks handshake_start_; // Time the handshake was started. 236 base::TimeTicks handshake_start_; // Time the handshake was started.
240 QuicConnectionLogger* logger_; // Owned by |connection_|. 237 QuicConnectionLogger* logger_; // Owned by |connection_|.
241 // Number of packets read in the current read loop. 238 // Number of packets read in the current read loop.
242 size_t num_packets_read_; 239 size_t num_packets_read_;
243 // True when the session is going away, and streams may no longer be created 240 // True when the session is going away, and streams may no longer be created
244 // on this session. Existing stream will continue to be processed. 241 // on this session. Existing stream will continue to be processed.
245 bool going_away_; 242 bool going_away_;
246 base::WeakPtrFactory<QuicClientSession> weak_factory_; 243 base::WeakPtrFactory<QuicClientSession> weak_factory_;
247 244
248 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); 245 DISALLOW_COPY_AND_ASSIGN(QuicClientSession);
249 }; 246 };
250 247
251 } // namespace net 248 } // namespace net
252 249
253 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ 250 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698