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 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 20 matching lines...) Expand all Loading... |
31 class HostResolver; | 31 class HostResolver; |
32 class HttpServerProperties; | 32 class HttpServerProperties; |
33 class QuicClock; | 33 class QuicClock; |
34 class QuicClientSession; | 34 class QuicClientSession; |
35 class QuicConnectionHelper; | 35 class QuicConnectionHelper; |
36 class QuicCryptoClientStreamFactory; | 36 class QuicCryptoClientStreamFactory; |
37 class QuicRandom; | 37 class QuicRandom; |
38 class QuicServerInfoFactory; | 38 class QuicServerInfoFactory; |
39 class QuicServerId; | 39 class QuicServerId; |
40 class QuicStreamFactory; | 40 class QuicStreamFactory; |
| 41 class ServerBoundCertService; |
41 | 42 |
42 namespace test { | 43 namespace test { |
43 class QuicStreamFactoryPeer; | 44 class QuicStreamFactoryPeer; |
44 } // namespace test | 45 } // namespace test |
45 | 46 |
46 // Encapsulates a pending request for a QuicHttpStream. | 47 // Encapsulates a pending request for a QuicHttpStream. |
47 // If the request is still pending when it is destroyed, it will | 48 // If the request is still pending when it is destroyed, it will |
48 // cancel the request with the factory. | 49 // cancel the request with the factory. |
49 class NET_EXPORT_PRIVATE QuicStreamRequest { | 50 class NET_EXPORT_PRIVATE QuicStreamRequest { |
50 public: | 51 public: |
51 explicit QuicStreamRequest(QuicStreamFactory* factory); | 52 explicit QuicStreamRequest(QuicStreamFactory* factory); |
52 ~QuicStreamRequest(); | 53 ~QuicStreamRequest(); |
53 | 54 |
54 // For http, |is_https| is false and |cert_verifier| can be null. | 55 // For http, |is_https| is false. |
55 int Request(const HostPortPair& host_port_pair, | 56 int Request(const HostPortPair& host_port_pair, |
56 bool is_https, | 57 bool is_https, |
57 PrivacyMode privacy_mode, | 58 PrivacyMode privacy_mode, |
58 base::StringPiece method, | 59 base::StringPiece method, |
59 const BoundNetLog& net_log, | 60 const BoundNetLog& net_log, |
60 const CompletionCallback& callback); | 61 const CompletionCallback& callback); |
61 | 62 |
62 void OnRequestComplete(int rv); | 63 void OnRequestComplete(int rv); |
63 | 64 |
64 scoped_ptr<QuicHttpStream> ReleaseStream(); | 65 scoped_ptr<QuicHttpStream> ReleaseStream(); |
(...skipping 19 matching lines...) Expand all Loading... |
84 // QuicClientSessions. | 85 // QuicClientSessions. |
85 class NET_EXPORT_PRIVATE QuicStreamFactory | 86 class NET_EXPORT_PRIVATE QuicStreamFactory |
86 : public NetworkChangeNotifier::IPAddressObserver, | 87 : public NetworkChangeNotifier::IPAddressObserver, |
87 public CertDatabase::Observer { | 88 public CertDatabase::Observer { |
88 public: | 89 public: |
89 QuicStreamFactory( | 90 QuicStreamFactory( |
90 HostResolver* host_resolver, | 91 HostResolver* host_resolver, |
91 ClientSocketFactory* client_socket_factory, | 92 ClientSocketFactory* client_socket_factory, |
92 base::WeakPtr<HttpServerProperties> http_server_properties, | 93 base::WeakPtr<HttpServerProperties> http_server_properties, |
93 CertVerifier* cert_verifier, | 94 CertVerifier* cert_verifier, |
| 95 ServerBoundCertService* server_bound_cert_service, |
94 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, | 96 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, |
95 QuicRandom* random_generator, | 97 QuicRandom* random_generator, |
96 QuicClock* clock, | 98 QuicClock* clock, |
97 size_t max_packet_length, | 99 size_t max_packet_length, |
98 const std::string& user_agent_id, | 100 const std::string& user_agent_id, |
99 const QuicVersionVector& supported_versions, | 101 const QuicVersionVector& supported_versions, |
100 bool enable_port_selection, | 102 bool enable_port_selection, |
101 bool enable_pacing, | 103 bool enable_pacing, |
102 bool enable_time_based_loss_detection); | 104 bool enable_time_based_loss_detection); |
103 virtual ~QuicStreamFactory(); | 105 virtual ~QuicStreamFactory(); |
104 | 106 |
105 // Creates a new QuicHttpStream to |host_port_pair| which will be | 107 // Creates a new QuicHttpStream to |host_port_pair| which will be |
106 // owned by |request|. |is_https| specifies if the protocol is https or not. | 108 // owned by |request|. |is_https| specifies if the protocol is https or not. |
107 // |cert_verifier| is used by ProofVerifier for verifying the certificate | 109 // If a matching session already exists, this method will return OK. If no |
108 // chain and signature. For http, this can be null. If a matching session | 110 // matching session exists, this will return ERR_IO_PENDING and will invoke |
109 // already exists, this method will return OK. If no matching session exists, | 111 // OnRequestComplete asynchronously. |
110 // this will return ERR_IO_PENDING and will invoke OnRequestComplete | |
111 // asynchronously. | |
112 int Create(const HostPortPair& host_port_pair, | 112 int Create(const HostPortPair& host_port_pair, |
113 bool is_https, | 113 bool is_https, |
114 PrivacyMode privacy_mode, | 114 PrivacyMode privacy_mode, |
115 base::StringPiece method, | 115 base::StringPiece method, |
116 const BoundNetLog& net_log, | 116 const BoundNetLog& net_log, |
117 QuicStreamRequest* request); | 117 QuicStreamRequest* request); |
118 | 118 |
119 // Called by a session when it becomes idle. | 119 // Called by a session when it becomes idle. |
120 void OnIdleSession(QuicClientSession* session); | 120 void OnIdleSession(QuicClientSession* session); |
121 | 121 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 const scoped_ptr<QuicServerInfo>& server_info); | 228 const scoped_ptr<QuicServerInfo>& server_info); |
229 | 229 |
230 void ProcessGoingAwaySession(QuicClientSession* session, | 230 void ProcessGoingAwaySession(QuicClientSession* session, |
231 const QuicServerId& server_id, | 231 const QuicServerId& server_id, |
232 bool was_session_active); | 232 bool was_session_active); |
233 | 233 |
234 bool require_confirmation_; | 234 bool require_confirmation_; |
235 HostResolver* host_resolver_; | 235 HostResolver* host_resolver_; |
236 ClientSocketFactory* client_socket_factory_; | 236 ClientSocketFactory* client_socket_factory_; |
237 base::WeakPtr<HttpServerProperties> http_server_properties_; | 237 base::WeakPtr<HttpServerProperties> http_server_properties_; |
238 CertVerifier* cert_verifier_; | |
239 QuicServerInfoFactory* quic_server_info_factory_; | 238 QuicServerInfoFactory* quic_server_info_factory_; |
240 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_; | 239 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_; |
241 QuicRandom* random_generator_; | 240 QuicRandom* random_generator_; |
242 scoped_ptr<QuicClock> clock_; | 241 scoped_ptr<QuicClock> clock_; |
243 const size_t max_packet_length_; | 242 const size_t max_packet_length_; |
244 | 243 |
245 // The helper used for all connections. | 244 // The helper used for all connections. |
246 scoped_ptr<QuicConnectionHelper> helper_; | 245 scoped_ptr<QuicConnectionHelper> helper_; |
247 | 246 |
248 // Contains owning pointers to all sessions that currently exist. | 247 // Contains owning pointers to all sessions that currently exist. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 uint64 port_seed_; | 280 uint64 port_seed_; |
282 | 281 |
283 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 282 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
284 | 283 |
285 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 284 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
286 }; | 285 }; |
287 | 286 |
288 } // namespace net | 287 } // namespace net |
289 | 288 |
290 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 289 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |