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

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

Issue 647933002: Call SetDefaults from the QuicConfig constructor instead of requiring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Allow_number_of_undecryptable_packets_76707156
Patch Set: Created 6 years, 2 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
« no previous file with comments | « net/quic/quic_server_bin.cc ('k') | net/quic/test_tools/crypto_test_utils.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 #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/cpu.h" 9 #include "base/cpu.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #if defined(OS_WIN) 83 #if defined(OS_WIN)
84 if (base::win::GetVersion() < base::win::VERSION_VISTA) 84 if (base::win::GetVersion() < base::win::VERSION_VISTA)
85 return false; 85 return false;
86 #endif 86 #endif
87 87
88 return true; 88 return true;
89 } 89 }
90 90
91 QuicConfig InitializeQuicConfig(const QuicTagVector& connection_options) { 91 QuicConfig InitializeQuicConfig(const QuicTagVector& connection_options) {
92 QuicConfig config; 92 QuicConfig config;
93 config.SetDefaults();
94 config.SetIdleConnectionStateLifetime( 93 config.SetIdleConnectionStateLifetime(
95 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds), 94 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds),
96 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds)); 95 QuicTime::Delta::FromSeconds(kIdleConnectionTimeoutSeconds));
97 config.SetConnectionOptionsToSend(connection_options); 96 config.SetConnectionOptionsToSend(connection_options);
98 return config; 97 return config;
99 } 98 }
100 99
101 class DefaultPacketWriterFactory : public QuicConnection::PacketWriterFactory { 100 class DefaultPacketWriterFactory : public QuicConnection::PacketWriterFactory {
102 public: 101 public:
103 explicit DefaultPacketWriterFactory(DatagramClientSocket* socket) 102 explicit DefaultPacketWriterFactory(DatagramClientSocket* socket)
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 config_(InitializeQuicConfig(connection_options)), 503 config_(InitializeQuicConfig(connection_options)),
505 supported_versions_(supported_versions), 504 supported_versions_(supported_versions),
506 enable_port_selection_(enable_port_selection), 505 enable_port_selection_(enable_port_selection),
507 always_require_handshake_confirmation_( 506 always_require_handshake_confirmation_(
508 always_require_handshake_confirmation), 507 always_require_handshake_confirmation),
509 disable_connection_pooling_(disable_connection_pooling), 508 disable_connection_pooling_(disable_connection_pooling),
510 port_seed_(random_generator_->RandUint64()), 509 port_seed_(random_generator_->RandUint64()),
511 check_persisted_supports_quic_(true), 510 check_persisted_supports_quic_(true),
512 weak_factory_(this) { 511 weak_factory_(this) {
513 DCHECK(transport_security_state_); 512 DCHECK(transport_security_state_);
514 crypto_config_.SetDefaults();
515 crypto_config_.set_user_agent_id(user_agent_id); 513 crypto_config_.set_user_agent_id(user_agent_id);
516 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); 514 crypto_config_.AddCanonicalSuffix(".c.youtube.com");
517 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); 515 crypto_config_.AddCanonicalSuffix(".googlevideo.com");
518 crypto_config_.SetProofVerifier( 516 crypto_config_.SetProofVerifier(
519 new ProofVerifierChromium(cert_verifier, transport_security_state)); 517 new ProofVerifierChromium(cert_verifier, transport_security_state));
520 crypto_config_.SetChannelIDSource( 518 crypto_config_.SetChannelIDSource(
521 new ChannelIDSourceChromium(channel_id_service)); 519 new ChannelIDSourceChromium(channel_id_service));
522 base::CPU cpu; 520 base::CPU cpu;
523 if (cpu.has_aesni() && cpu.has_avx()) 521 if (cpu.has_aesni() && cpu.has_avx())
524 crypto_config_.PreferAesGcm(); 522 crypto_config_.PreferAesGcm();
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 http_server_properties_->ClearAlternateProtocol(server); 1023 http_server_properties_->ClearAlternateProtocol(server);
1026 http_server_properties_->SetAlternateProtocol( 1024 http_server_properties_->SetAlternateProtocol(
1027 server, alternate.port, alternate.protocol, 1); 1025 server, alternate.port, alternate.protocol, 1);
1028 DCHECK_EQ(QUIC, 1026 DCHECK_EQ(QUIC,
1029 http_server_properties_->GetAlternateProtocol(server).protocol); 1027 http_server_properties_->GetAlternateProtocol(server).protocol);
1030 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( 1028 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken(
1031 server)); 1029 server));
1032 } 1030 }
1033 1031
1034 } // namespace net 1032 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_server_bin.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698