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_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 class NET_EXPORT_PRIVATE QuicStreamRequest { | 108 class NET_EXPORT_PRIVATE QuicStreamRequest { |
109 public: | 109 public: |
110 explicit QuicStreamRequest(QuicStreamFactory* factory); | 110 explicit QuicStreamRequest(QuicStreamFactory* factory); |
111 ~QuicStreamRequest(); | 111 ~QuicStreamRequest(); |
112 | 112 |
113 // |cert_verify_flags| is bitwise OR'd of CertVerifier::VerifyFlags and it is | 113 // |cert_verify_flags| is bitwise OR'd of CertVerifier::VerifyFlags and it is |
114 // passed to CertVerifier::Verify. | 114 // passed to CertVerifier::Verify. |
115 // |destination| will be resolved and resulting IPEndPoint used to open a | 115 // |destination| will be resolved and resulting IPEndPoint used to open a |
116 // QuicConnection. This can be different than HostPortPair::FromURL(url). | 116 // QuicConnection. This can be different than HostPortPair::FromURL(url). |
117 int Request(const HostPortPair& destination, | 117 int Request(const HostPortPair& destination, |
| 118 const QuicVersionVector& advertised_versions, |
118 PrivacyMode privacy_mode, | 119 PrivacyMode privacy_mode, |
119 int cert_verify_flags, | 120 int cert_verify_flags, |
120 const GURL& url, | 121 const GURL& url, |
121 QuicStringPiece method, | 122 QuicStringPiece method, |
122 const NetLogWithSource& net_log, | 123 const NetLogWithSource& net_log, |
123 const CompletionCallback& callback); | 124 const CompletionCallback& callback); |
124 | 125 |
125 void OnRequestComplete(int rv); | 126 void OnRequestComplete(int rv); |
126 | 127 |
127 // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It | 128 // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bool CanUseExistingSession(const QuicServerId& server_id, | 227 bool CanUseExistingSession(const QuicServerId& server_id, |
227 const HostPortPair& destination); | 228 const HostPortPair& destination); |
228 | 229 |
229 // Creates a new QuicHttpStream to |host_port_pair| which will be | 230 // Creates a new QuicHttpStream to |host_port_pair| which will be |
230 // owned by |request|. | 231 // owned by |request|. |
231 // If a matching session already exists, this method will return OK. If no | 232 // If a matching session already exists, this method will return OK. If no |
232 // matching session exists, this will return ERR_IO_PENDING and will invoke | 233 // matching session exists, this will return ERR_IO_PENDING and will invoke |
233 // OnRequestComplete asynchronously. | 234 // OnRequestComplete asynchronously. |
234 int Create(const QuicServerId& server_id, | 235 int Create(const QuicServerId& server_id, |
235 const HostPortPair& destination, | 236 const HostPortPair& destination, |
| 237 const QuicVersionVector& advertised_versions, |
236 int cert_verify_flags, | 238 int cert_verify_flags, |
237 const GURL& url, | 239 const GURL& url, |
238 QuicStringPiece method, | 240 QuicStringPiece method, |
239 const NetLogWithSource& net_log, | 241 const NetLogWithSource& net_log, |
240 QuicStreamRequest* request); | 242 QuicStreamRequest* request); |
241 | 243 |
242 // Called when the handshake for |session| is confirmed. If QUIC is disabled | 244 // Called when the handshake for |session| is confirmed. If QUIC is disabled |
243 // currently disabled, then it closes the connection and returns true. | 245 // currently disabled, then it closes the connection and returns true. |
244 bool OnHandshakeConfirmed(QuicChromiumClientSession* session); | 246 bool OnHandshakeConfirmed(QuicChromiumClientSession* session); |
245 | 247 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 typedef std::map<QuicServerId, std::unique_ptr<CertVerifierJob>> | 396 typedef std::map<QuicServerId, std::unique_ptr<CertVerifierJob>> |
395 CertVerifierJobMap; | 397 CertVerifierJobMap; |
396 | 398 |
397 bool OnResolution(const QuicSessionKey& key, const AddressList& address_list); | 399 bool OnResolution(const QuicSessionKey& key, const AddressList& address_list); |
398 void OnJobComplete(Job* job, int rv); | 400 void OnJobComplete(Job* job, int rv); |
399 void OnCertVerifyJobComplete(CertVerifierJob* job, int rv); | 401 void OnCertVerifyJobComplete(CertVerifierJob* job, int rv); |
400 bool HasActiveSession(const QuicServerId& server_id) const; | 402 bool HasActiveSession(const QuicServerId& server_id) const; |
401 bool HasActiveJob(const QuicServerId& server_id) const; | 403 bool HasActiveJob(const QuicServerId& server_id) const; |
402 bool HasActiveCertVerifierJob(const QuicServerId& server_id) const; | 404 bool HasActiveCertVerifierJob(const QuicServerId& server_id) const; |
403 int CreateSession(const QuicSessionKey& key, | 405 int CreateSession(const QuicSessionKey& key, |
| 406 const QuicVersion& quic_version, |
404 int cert_verify_flags, | 407 int cert_verify_flags, |
405 bool require_confirmation, | 408 bool require_confirmation, |
406 const AddressList& address_list, | 409 const AddressList& address_list, |
407 base::TimeTicks dns_resolution_start_time, | 410 base::TimeTicks dns_resolution_start_time, |
408 base::TimeTicks dns_resolution_end_time, | 411 base::TimeTicks dns_resolution_end_time, |
409 const NetLogWithSource& net_log, | 412 const NetLogWithSource& net_log, |
410 QuicChromiumClientSession** session); | 413 QuicChromiumClientSession** session); |
411 void ActivateSession(const QuicSessionKey& key, | 414 void ActivateSession(const QuicSessionKey& key, |
412 QuicChromiumClientSession* session); | 415 QuicChromiumClientSession* session); |
413 | 416 |
414 void ConfigureInitialRttEstimate(const QuicServerId& server_id, | 417 void ConfigureInitialRttEstimate(const QuicServerId& server_id, |
415 QuicConfig* config); | 418 QuicConfig* config); |
416 | 419 |
| 420 // Returns the first mutually supported QUIC version in |supported_versions_|. |
| 421 // If there is no mutually supported QUIC version, return the first entry in |
| 422 // |supported_versions_|. |
| 423 // |supproted_versions_| should be listed in the order of most preferred QUIC |
| 424 // versions. |
| 425 QuicVersion SelectQuicVersion( |
| 426 const QuicVersionVector& advertised_versions) const; |
| 427 |
417 // Returns |srtt| in micro seconds from ServerNetworkStats. Returns 0 if there | 428 // Returns |srtt| in micro seconds from ServerNetworkStats. Returns 0 if there |
418 // is no |http_server_properties_| or if |http_server_properties_| doesn't | 429 // is no |http_server_properties_| or if |http_server_properties_| doesn't |
419 // have ServerNetworkStats for the given |server_id|. | 430 // have ServerNetworkStats for the given |server_id|. |
420 int64_t GetServerNetworkStatsSmoothedRttInMicroseconds( | 431 int64_t GetServerNetworkStatsSmoothedRttInMicroseconds( |
421 const QuicServerId& server_id) const; | 432 const QuicServerId& server_id) const; |
422 | 433 |
423 // Returns |srtt| from ServerNetworkStats. Returns null if there | 434 // Returns |srtt| from ServerNetworkStats. Returns null if there |
424 // is no |http_server_properties_| or if |http_server_properties_| doesn't | 435 // is no |http_server_properties_| or if |http_server_properties_| doesn't |
425 // have ServerNetworkStats for the given |server_id|. | 436 // have ServerNetworkStats for the given |server_id|. |
426 const base::TimeDelta* GetServerNetworkStatsSmoothedRtt( | 437 const base::TimeDelta* GetServerNetworkStatsSmoothedRtt( |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 const scoped_refptr<SSLConfigService> ssl_config_service_; | 584 const scoped_refptr<SSLConfigService> ssl_config_service_; |
574 | 585 |
575 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 586 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
576 | 587 |
577 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 588 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
578 }; | 589 }; |
579 | 590 |
580 } // namespace net | 591 } // namespace net |
581 | 592 |
582 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 593 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |