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

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: self review 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 QuicVersion quic_version,
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
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
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 const scoped_refptr<SSLConfigService> ssl_config_service_; 579 const scoped_refptr<SSLConfigService> ssl_config_service_;
577 580
578 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 581 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
579 582
580 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 583 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
581 }; 584 };
582 585
583 } // namespace net 586 } // namespace net
584 587
585 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ 588 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698