| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 typedef std::map<QuicServerId, std::unique_ptr<CertVerifierJob>> | 399 typedef std::map<QuicServerId, std::unique_ptr<CertVerifierJob>> |
| 398 CertVerifierJobMap; | 400 CertVerifierJobMap; |
| 399 | 401 |
| 400 bool OnResolution(const QuicSessionKey& key, const AddressList& address_list); | 402 bool OnResolution(const QuicSessionKey& key, const AddressList& address_list); |
| 401 void OnJobComplete(Job* job, int rv); | 403 void OnJobComplete(Job* job, int rv); |
| 402 void OnCertVerifyJobComplete(CertVerifierJob* job, int rv); | 404 void OnCertVerifyJobComplete(CertVerifierJob* job, int rv); |
| 403 bool HasActiveSession(const QuicServerId& server_id) const; | 405 bool HasActiveSession(const QuicServerId& server_id) const; |
| 404 bool HasActiveJob(const QuicServerId& server_id) const; | 406 bool HasActiveJob(const QuicServerId& server_id) const; |
| 405 bool HasActiveCertVerifierJob(const QuicServerId& server_id) const; | 407 bool HasActiveCertVerifierJob(const QuicServerId& server_id) const; |
| 406 int CreateSession(const QuicSessionKey& key, | 408 int CreateSession(const QuicSessionKey& key, |
| 409 const QuicVersion& quic_version, |
| 407 int cert_verify_flags, | 410 int cert_verify_flags, |
| 408 bool require_confirmation, | 411 bool require_confirmation, |
| 409 const AddressList& address_list, | 412 const AddressList& address_list, |
| 410 base::TimeTicks dns_resolution_start_time, | 413 base::TimeTicks dns_resolution_start_time, |
| 411 base::TimeTicks dns_resolution_end_time, | 414 base::TimeTicks dns_resolution_end_time, |
| 412 const NetLogWithSource& net_log, | 415 const NetLogWithSource& net_log, |
| 413 QuicChromiumClientSession** session); | 416 QuicChromiumClientSession** session); |
| 414 void ActivateSession(const QuicSessionKey& key, | 417 void ActivateSession(const QuicSessionKey& key, |
| 415 QuicChromiumClientSession* session); | 418 QuicChromiumClientSession* session); |
| 416 | 419 |
| 417 void ConfigureInitialRttEstimate(const QuicServerId& server_id, | 420 void ConfigureInitialRttEstimate(const QuicServerId& server_id, |
| 418 QuicConfig* config); | 421 QuicConfig* config); |
| 419 | 422 |
| 423 // Returns the first mutually supported QUIC version based on |
| 424 // |supported_versions|. If there is no mutually supported QUIC version, |
| 425 // return the first entry in |supported_versions_|. |
| 426 // |supported_versions_| should be listed in the order of most preferred QUIC |
| 427 // verions. |
| 428 QuicVersion SelectQuicVersion( |
| 429 const QuicVersionVector& advertised_versions) const; |
| 430 |
| 420 // Returns |srtt| in micro seconds from ServerNetworkStats. Returns 0 if there | 431 // Returns |srtt| in micro seconds from ServerNetworkStats. Returns 0 if there |
| 421 // is no |http_server_properties_| or if |http_server_properties_| doesn't | 432 // is no |http_server_properties_| or if |http_server_properties_| doesn't |
| 422 // have ServerNetworkStats for the given |server_id|. | 433 // have ServerNetworkStats for the given |server_id|. |
| 423 int64_t GetServerNetworkStatsSmoothedRttInMicroseconds( | 434 int64_t GetServerNetworkStatsSmoothedRttInMicroseconds( |
| 424 const QuicServerId& server_id) const; | 435 const QuicServerId& server_id) const; |
| 425 | 436 |
| 426 // Returns |srtt| from ServerNetworkStats. Returns null if there | 437 // Returns |srtt| from ServerNetworkStats. Returns null if there |
| 427 // is no |http_server_properties_| or if |http_server_properties_| doesn't | 438 // is no |http_server_properties_| or if |http_server_properties_| doesn't |
| 428 // have ServerNetworkStats for the given |server_id|. | 439 // have ServerNetworkStats for the given |server_id|. |
| 429 const base::TimeDelta* GetServerNetworkStatsSmoothedRtt( | 440 const base::TimeDelta* GetServerNetworkStatsSmoothedRtt( |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 const scoped_refptr<SSLConfigService> ssl_config_service_; | 587 const scoped_refptr<SSLConfigService> ssl_config_service_; |
| 577 | 588 |
| 578 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 589 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
| 579 | 590 |
| 580 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 591 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
| 581 }; | 592 }; |
| 582 | 593 |
| 583 } // namespace net | 594 } // namespace net |
| 584 | 595 |
| 585 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 596 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
| OLD | NEW |