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

Side by Side Diff: net/quic/chromium/quic_stream_factory.h

Issue 2958133002: Change QuicStreamRequest::Request() to take a preferred QuicVersion so that (Closed)
Patch Set: Re #26 Created 3 years, 5 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 #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
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 QuicVersion quic_version,
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 CTPolicyEnforcer* ct_policy_enforcer, 196 CTPolicyEnforcer* ct_policy_enforcer,
196 ChannelIDService* channel_id_service, 197 ChannelIDService* channel_id_service,
197 TransportSecurityState* transport_security_state, 198 TransportSecurityState* transport_security_state,
198 CTVerifier* cert_transparency_verifier, 199 CTVerifier* cert_transparency_verifier,
199 SocketPerformanceWatcherFactory* socket_performance_watcher_factory, 200 SocketPerformanceWatcherFactory* socket_performance_watcher_factory,
200 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, 201 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory,
201 QuicRandom* random_generator, 202 QuicRandom* random_generator,
202 QuicClock* clock, 203 QuicClock* clock,
203 size_t max_packet_length, 204 size_t max_packet_length,
204 const std::string& user_agent_id, 205 const std::string& user_agent_id,
205 const QuicVersionVector& supported_versions,
206 bool store_server_configs_in_properties, 206 bool store_server_configs_in_properties,
207 bool close_sessions_on_ip_change, 207 bool close_sessions_on_ip_change,
208 bool mark_quic_broken_when_network_blackholes, 208 bool mark_quic_broken_when_network_blackholes,
209 int idle_connection_timeout_seconds, 209 int idle_connection_timeout_seconds,
210 int reduced_ping_timeout_seconds, 210 int reduced_ping_timeout_seconds,
211 int packet_reader_yield_after_duration_milliseconds, 211 int packet_reader_yield_after_duration_milliseconds,
212 bool migrate_sessions_on_network_change, 212 bool migrate_sessions_on_network_change,
213 bool migrate_sessions_early, 213 bool migrate_sessions_early,
214 bool allow_server_migration, 214 bool allow_server_migration,
215 bool force_hol_blocking, 215 bool force_hol_blocking,
(...skipping 10 matching lines...) Expand all
226 bool CanUseExistingSession(const QuicServerId& server_id, 226 bool CanUseExistingSession(const QuicServerId& server_id,
227 const HostPortPair& destination); 227 const HostPortPair& destination);
228 228
229 // Creates a new QuicHttpStream to |host_port_pair| which will be 229 // Creates a new QuicHttpStream to |host_port_pair| which will be
230 // owned by |request|. 230 // owned by |request|.
231 // If a matching session already exists, this method will return OK. If no 231 // 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 232 // matching session exists, this will return ERR_IO_PENDING and will invoke
233 // OnRequestComplete asynchronously. 233 // OnRequestComplete asynchronously.
234 int Create(const QuicServerId& server_id, 234 int Create(const QuicServerId& server_id,
235 const HostPortPair& destination, 235 const HostPortPair& destination,
236 QuicVersion quic_version,
236 int cert_verify_flags, 237 int cert_verify_flags,
237 const GURL& url, 238 const GURL& url,
238 QuicStringPiece method, 239 QuicStringPiece method,
239 const NetLogWithSource& net_log, 240 const NetLogWithSource& net_log,
240 QuicStreamRequest* request); 241 QuicStreamRequest* request);
241 242
242 // Called when the handshake for |session| is confirmed. If QUIC is disabled 243 // Called when the handshake for |session| is confirmed. If QUIC is disabled
243 // currently disabled, then it closes the connection and returns true. 244 // currently disabled, then it closes the connection and returns true.
244 bool OnHandshakeConfirmed(QuicChromiumClientSession* session); 245 bool OnHandshakeConfirmed(QuicChromiumClientSession* session);
245 246
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 typedef std::map<QuicServerId, std::unique_ptr<CertVerifierJob>> 398 typedef std::map<QuicServerId, std::unique_ptr<CertVerifierJob>>
398 CertVerifierJobMap; 399 CertVerifierJobMap;
399 400
400 bool OnResolution(const QuicSessionKey& key, const AddressList& address_list); 401 bool OnResolution(const QuicSessionKey& key, const AddressList& address_list);
401 void OnJobComplete(Job* job, int rv); 402 void OnJobComplete(Job* job, int rv);
402 void OnCertVerifyJobComplete(CertVerifierJob* job, int rv); 403 void OnCertVerifyJobComplete(CertVerifierJob* job, int rv);
403 bool HasActiveSession(const QuicServerId& server_id) const; 404 bool HasActiveSession(const QuicServerId& server_id) const;
404 bool HasActiveJob(const QuicServerId& server_id) const; 405 bool HasActiveJob(const QuicServerId& server_id) const;
405 bool HasActiveCertVerifierJob(const QuicServerId& server_id) const; 406 bool HasActiveCertVerifierJob(const QuicServerId& server_id) const;
406 int CreateSession(const QuicSessionKey& key, 407 int CreateSession(const QuicSessionKey& key,
408 const QuicVersion& quic_version,
407 int cert_verify_flags, 409 int cert_verify_flags,
408 bool require_confirmation, 410 bool require_confirmation,
409 const AddressList& address_list, 411 const AddressList& address_list,
410 base::TimeTicks dns_resolution_start_time, 412 base::TimeTicks dns_resolution_start_time,
411 base::TimeTicks dns_resolution_end_time, 413 base::TimeTicks dns_resolution_end_time,
412 const NetLogWithSource& net_log, 414 const NetLogWithSource& net_log,
413 QuicChromiumClientSession** session); 415 QuicChromiumClientSession** session);
414 void ActivateSession(const QuicSessionKey& key, 416 void ActivateSession(const QuicSessionKey& key,
415 QuicChromiumClientSession* session); 417 QuicChromiumClientSession* session);
416 418
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 const QuicConfig config_; 510 const QuicConfig config_;
509 QuicCryptoClientConfig crypto_config_; 511 QuicCryptoClientConfig crypto_config_;
510 512
511 JobMap active_jobs_; 513 JobMap active_jobs_;
512 // Map from QuicServerId to a set of non-owning QuicStreamRequest pointers. 514 // Map from QuicServerId to a set of non-owning QuicStreamRequest pointers.
513 ServerIDRequestsMap job_requests_map_; 515 ServerIDRequestsMap job_requests_map_;
514 516
515 // Map of QuicServerId to owning CertVerifierJob. 517 // Map of QuicServerId to owning CertVerifierJob.
516 CertVerifierJobMap active_cert_verifier_jobs_; 518 CertVerifierJobMap active_cert_verifier_jobs_;
517 519
518 const QuicVersionVector supported_versions_;
519
520 // True if QUIC should be marked as broken when a connection blackholes after 520 // True if QUIC should be marked as broken when a connection blackholes after
521 // the handshake is confirmed. 521 // the handshake is confirmed.
522 bool mark_quic_broken_when_network_blackholes_; 522 bool mark_quic_broken_when_network_blackholes_;
523 523
524 // Set if QUIC server configs should be stored in HttpServerProperties. 524 // Set if QUIC server configs should be stored in HttpServerProperties.
525 bool store_server_configs_in_properties_; 525 bool store_server_configs_in_properties_;
526 526
527 // PING timeout for connections. 527 // PING timeout for connections.
528 QuicTime::Delta ping_timeout_; 528 QuicTime::Delta ping_timeout_;
529 QuicTime::Delta reduced_ping_timeout_; 529 QuicTime::Delta reduced_ping_timeout_;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 const scoped_refptr<SSLConfigService> ssl_config_service_; 576 const scoped_refptr<SSLConfigService> ssl_config_service_;
577 577
578 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 578 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
579 579
580 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 580 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
581 }; 581 };
582 582
583 } // namespace net 583 } // namespace net
584 584
585 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ 585 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_network_transaction_unittest.cc ('k') | net/quic/chromium/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698