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 QuicTagVector connection_options); | 105 QuicTagVector connection_options); |
104 virtual ~QuicStreamFactory(); | 106 virtual ~QuicStreamFactory(); |
105 | 107 |
106 // Creates a new QuicHttpStream to |host_port_pair| which will be | 108 // Creates a new QuicHttpStream to |host_port_pair| which will be |
107 // owned by |request|. |is_https| specifies if the protocol is https or not. | 109 // owned by |request|. |is_https| specifies if the protocol is https or not. |
108 // |cert_verifier| is used by ProofVerifier for verifying the certificate | 110 // If a matching session already exists, this method will return OK. If no |
109 // chain and signature. For http, this can be null. If a matching session | 111 // matching session exists, this will return ERR_IO_PENDING and will invoke |
110 // already exists, this method will return OK. If no matching session exists, | 112 // OnRequestComplete asynchronously. |
111 // this will return ERR_IO_PENDING and will invoke OnRequestComplete | |
112 // asynchronously. | |
113 int Create(const HostPortPair& host_port_pair, | 113 int Create(const HostPortPair& host_port_pair, |
114 bool is_https, | 114 bool is_https, |
115 PrivacyMode privacy_mode, | 115 PrivacyMode privacy_mode, |
116 base::StringPiece method, | 116 base::StringPiece method, |
117 const BoundNetLog& net_log, | 117 const BoundNetLog& net_log, |
118 QuicStreamRequest* request); | 118 QuicStreamRequest* request); |
119 | 119 |
120 // Called by a session when it becomes idle. | 120 // Called by a session when it becomes idle. |
121 void OnIdleSession(QuicClientSession* session); | 121 void OnIdleSession(QuicClientSession* session); |
122 | 122 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 const scoped_ptr<QuicServerInfo>& server_info); | 229 const scoped_ptr<QuicServerInfo>& server_info); |
230 | 230 |
231 void ProcessGoingAwaySession(QuicClientSession* session, | 231 void ProcessGoingAwaySession(QuicClientSession* session, |
232 const QuicServerId& server_id, | 232 const QuicServerId& server_id, |
233 bool was_session_active); | 233 bool was_session_active); |
234 | 234 |
235 bool require_confirmation_; | 235 bool require_confirmation_; |
236 HostResolver* host_resolver_; | 236 HostResolver* host_resolver_; |
237 ClientSocketFactory* client_socket_factory_; | 237 ClientSocketFactory* client_socket_factory_; |
238 base::WeakPtr<HttpServerProperties> http_server_properties_; | 238 base::WeakPtr<HttpServerProperties> http_server_properties_; |
239 CertVerifier* cert_verifier_; | |
240 QuicServerInfoFactory* quic_server_info_factory_; | 239 QuicServerInfoFactory* quic_server_info_factory_; |
241 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_; | 240 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory_; |
242 QuicRandom* random_generator_; | 241 QuicRandom* random_generator_; |
243 scoped_ptr<QuicClock> clock_; | 242 scoped_ptr<QuicClock> clock_; |
244 const size_t max_packet_length_; | 243 const size_t max_packet_length_; |
245 | 244 |
246 // The helper used for all connections. | 245 // The helper used for all connections. |
247 scoped_ptr<QuicConnectionHelper> helper_; | 246 scoped_ptr<QuicConnectionHelper> helper_; |
248 | 247 |
249 // Contains owning pointers to all sessions that currently exist. | 248 // Contains owning pointers to all sessions that currently exist. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 uint64 port_seed_; | 281 uint64 port_seed_; |
283 | 282 |
284 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 283 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
285 | 284 |
286 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 285 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
287 }; | 286 }; |
288 | 287 |
289 } // namespace net | 288 } // namespace net |
290 | 289 |
291 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 290 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |