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

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

Issue 127463003: Completely disable use of bind() with pseudo-random port selection on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: On Windows, avoid "port selection" in Stable or Beta channels automatically Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 public CertDatabase::Observer { 83 public CertDatabase::Observer {
84 public: 84 public:
85 QuicStreamFactory( 85 QuicStreamFactory(
86 HostResolver* host_resolver, 86 HostResolver* host_resolver,
87 ClientSocketFactory* client_socket_factory, 87 ClientSocketFactory* client_socket_factory,
88 base::WeakPtr<HttpServerProperties> http_server_properties, 88 base::WeakPtr<HttpServerProperties> http_server_properties,
89 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory, 89 QuicCryptoClientStreamFactory* quic_crypto_client_stream_factory,
90 QuicRandom* random_generator, 90 QuicRandom* random_generator,
91 QuicClock* clock, 91 QuicClock* clock,
92 size_t max_packet_length, 92 size_t max_packet_length,
93 const QuicVersionVector& supported_versions); 93 const QuicVersionVector& supported_versions,
94 bool enable_port_selection);
94 virtual ~QuicStreamFactory(); 95 virtual ~QuicStreamFactory();
95 96
96 // Creates a new QuicHttpStream to |host_port_proxy_pair| which will be 97 // Creates a new QuicHttpStream to |host_port_proxy_pair| which will be
97 // owned by |request|. |is_https| specifies if the protocol is https or not. 98 // owned by |request|. |is_https| specifies if the protocol is https or not.
98 // |cert_verifier| is used by ProofVerifier for verifying the certificate 99 // |cert_verifier| is used by ProofVerifier for verifying the certificate
99 // chain and signature. For http, this can be null. If a matching session 100 // chain and signature. For http, this can be null. If a matching session
100 // already exists, this method will return OK. If no matching session exists, 101 // already exists, this method will return OK. If no matching session exists,
101 // this will return ERR_IO_PENDING and will invoke OnRequestComplete 102 // this will return ERR_IO_PENDING and will invoke OnRequestComplete
102 // asynchronously. 103 // asynchronously.
103 int Create(const HostPortProxyPair& host_port_proxy_pair, 104 int Create(const HostPortProxyPair& host_port_proxy_pair,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 std::vector<std::string> cannoncial_suffixes_; 231 std::vector<std::string> cannoncial_suffixes_;
231 232
232 QuicConfig config_; 233 QuicConfig config_;
233 234
234 JobMap active_jobs_; 235 JobMap active_jobs_;
235 JobRequestsMap job_requests_map_; 236 JobRequestsMap job_requests_map_;
236 RequestMap active_requests_; 237 RequestMap active_requests_;
237 238
238 QuicVersionVector supported_versions_; 239 QuicVersionVector supported_versions_;
239 240
241 // Determine is we should consistently select a client UDP port. If false,
242 // then we will just lest the OS select a random client port for each new
243 // connection.
244 bool enable_port_selection_;
245
240 // Each profile will (probably) have a unique port_seed_ value. This value is 246 // Each profile will (probably) have a unique port_seed_ value. This value is
241 // used to help seed a pseudo-random number generator (PortSuggester) so that 247 // used to help seed a pseudo-random number generator (PortSuggester) so that
242 // we consistently (within this profile) suggest the same ephemeral port when 248 // we consistently (within this profile) suggest the same ephemeral port when
243 // we re-connect to any given server/port. The differences between profiles 249 // we re-connect to any given server/port. The differences between profiles
244 // (probablistically) prevent two profiles from colliding in their ephemeral 250 // (probablistically) prevent two profiles from colliding in their ephemeral
245 // port requests. 251 // port requests.
246 uint64 port_seed_; 252 uint64 port_seed_;
247 253
248 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 254 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
249 255
250 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 256 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
251 }; 257 };
252 258
253 } // namespace net 259 } // namespace net
254 260
255 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ 261 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_
OLDNEW
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698