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

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

Issue 103343004: Change port_entropy to port_seed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | no next file » | 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 #include "net/quic/quic_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 size_t max_packet_length) 259 size_t max_packet_length)
260 : require_confirmation_(true), 260 : require_confirmation_(true),
261 host_resolver_(host_resolver), 261 host_resolver_(host_resolver),
262 client_socket_factory_(client_socket_factory), 262 client_socket_factory_(client_socket_factory),
263 http_server_properties_(http_server_properties), 263 http_server_properties_(http_server_properties),
264 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), 264 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory),
265 random_generator_(random_generator), 265 random_generator_(random_generator),
266 clock_(clock), 266 clock_(clock),
267 max_packet_length_(max_packet_length), 267 max_packet_length_(max_packet_length),
268 weak_factory_(this), 268 weak_factory_(this),
269 port_entropy_(random_generator_->RandUint64()) { 269 port_seed_(random_generator_->RandUint64()) {
270 config_.SetDefaults(); 270 config_.SetDefaults();
271 config_.set_idle_connection_state_lifetime( 271 config_.set_idle_connection_state_lifetime(
272 QuicTime::Delta::FromSeconds(30), 272 QuicTime::Delta::FromSeconds(30),
273 QuicTime::Delta::FromSeconds(30)); 273 QuicTime::Delta::FromSeconds(30));
274 274
275 cannoncial_suffixes_.push_back(string(".c.youtube.com")); 275 cannoncial_suffixes_.push_back(string(".c.youtube.com"));
276 cannoncial_suffixes_.push_back(string(".googlevideo.com")); 276 cannoncial_suffixes_.push_back(string(".googlevideo.com"));
277 } 277 }
278 278
279 QuicStreamFactory::~QuicStreamFactory() { 279 QuicStreamFactory::~QuicStreamFactory() {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 int QuicStreamFactory::CreateSession( 453 int QuicStreamFactory::CreateSession(
454 const HostPortProxyPair& host_port_proxy_pair, 454 const HostPortProxyPair& host_port_proxy_pair,
455 bool is_https, 455 bool is_https,
456 CertVerifier* cert_verifier, 456 CertVerifier* cert_verifier,
457 const AddressList& address_list, 457 const AddressList& address_list,
458 const BoundNetLog& net_log, 458 const BoundNetLog& net_log,
459 QuicClientSession** session) { 459 QuicClientSession** session) {
460 QuicGuid guid = random_generator_->RandUint64(); 460 QuicGuid guid = random_generator_->RandUint64();
461 IPEndPoint addr = *address_list.begin(); 461 IPEndPoint addr = *address_list.begin();
462 scoped_refptr<PortSuggester> port_suggester = 462 scoped_refptr<PortSuggester> port_suggester =
463 new PortSuggester(host_port_proxy_pair.first, port_entropy_); 463 new PortSuggester(host_port_proxy_pair.first, port_seed_);
464 scoped_ptr<DatagramClientSocket> socket( 464 scoped_ptr<DatagramClientSocket> socket(
465 client_socket_factory_->CreateDatagramClientSocket( 465 client_socket_factory_->CreateDatagramClientSocket(
466 DatagramSocket::RANDOM_BIND, 466 DatagramSocket::RANDOM_BIND,
467 base::Bind(&PortSuggester::SuggestPort, port_suggester), 467 base::Bind(&PortSuggester::SuggestPort, port_suggester),
468 net_log.net_log(), net_log.source())); 468 net_log.net_log(), net_log.source()));
469 int rv = socket->Connect(addr); 469 int rv = socket->Connect(addr);
470 if (rv != OK) 470 if (rv != OK)
471 return rv; 471 return rv;
472 UMA_HISTOGRAM_COUNTS("Net.QuicEphemeralPortsSuggested", 472 UMA_HISTOGRAM_COUNTS("Net.QuicEphemeralPortsSuggested",
473 port_suggester->call_count()); 473 port_suggester->call_count());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 // Copy the CachedState for the canonical server from canonical_crypto_config 578 // Copy the CachedState for the canonical server from canonical_crypto_config
579 // as the initial CachedState for the server_hostname in crypto_config. 579 // as the initial CachedState for the server_hostname in crypto_config.
580 crypto_config->InitializeFrom(server_hostname, 580 crypto_config->InitializeFrom(server_hostname,
581 canonical_host_port_proxy_pair.first.host(), 581 canonical_host_port_proxy_pair.first.host(),
582 canonical_crypto_config); 582 canonical_crypto_config);
583 // Update canonical version to point at the "most recent" crypto_config. 583 // Update canonical version to point at the "most recent" crypto_config.
584 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair; 584 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair;
585 } 585 }
586 586
587 } // namespace net 587 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698