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

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

Issue 209413005: Move Window's specific logic for disabling ECDSA from QuicCryptoyclientConfig (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 16 matching lines...) Expand all
27 #include "net/quic/quic_clock.h" 27 #include "net/quic/quic_clock.h"
28 #include "net/quic/quic_connection.h" 28 #include "net/quic/quic_connection.h"
29 #include "net/quic/quic_connection_helper.h" 29 #include "net/quic/quic_connection_helper.h"
30 #include "net/quic/quic_crypto_client_stream_factory.h" 30 #include "net/quic/quic_crypto_client_stream_factory.h"
31 #include "net/quic/quic_default_packet_writer.h" 31 #include "net/quic/quic_default_packet_writer.h"
32 #include "net/quic/quic_http_stream.h" 32 #include "net/quic/quic_http_stream.h"
33 #include "net/quic/quic_protocol.h" 33 #include "net/quic/quic_protocol.h"
34 #include "net/quic/quic_session_key.h" 34 #include "net/quic/quic_session_key.h"
35 #include "net/socket/client_socket_factory.h" 35 #include "net/socket/client_socket_factory.h"
36 36
37 #if defined(OS_WIN)
38 #include "base/win/windows_version.h"
39 #endif
40
37 using std::string; 41 using std::string;
38 using std::vector; 42 using std::vector;
39 43
40 namespace net { 44 namespace net {
41 45
42 namespace { 46 namespace {
43 47
44 const uint64 kBrokenAlternateProtocolDelaySecs = 300; 48 const uint64 kBrokenAlternateProtocolDelaySecs = 300;
45 49
50 bool IsEcdsaSupported() {
51 #if defined(OS_WIN)
52 if (base::win::GetVersion() < base::win::VERSION_VISTA)
53 return false;
54 #endif
55
56 return true;
57 }
58
46 } // namespace 59 } // namespace
47 60
48 QuicStreamFactory::IpAliasKey::IpAliasKey() {} 61 QuicStreamFactory::IpAliasKey::IpAliasKey() {}
49 62
50 QuicStreamFactory::IpAliasKey::IpAliasKey(IPEndPoint ip_endpoint, 63 QuicStreamFactory::IpAliasKey::IpAliasKey(IPEndPoint ip_endpoint,
51 bool is_https) 64 bool is_https)
52 : ip_endpoint(ip_endpoint), 65 : ip_endpoint(ip_endpoint),
53 is_https(is_https) {} 66 is_https(is_https) {}
54 67
55 QuicStreamFactory::IpAliasKey::~IpAliasKey() {} 68 QuicStreamFactory::IpAliasKey::~IpAliasKey() {}
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 config_.SetDefaults(); 389 config_.SetDefaults();
377 config_.EnablePacing(enable_pacing_); 390 config_.EnablePacing(enable_pacing_);
378 config_.set_idle_connection_state_lifetime( 391 config_.set_idle_connection_state_lifetime(
379 QuicTime::Delta::FromSeconds(30), 392 QuicTime::Delta::FromSeconds(30),
380 QuicTime::Delta::FromSeconds(30)); 393 QuicTime::Delta::FromSeconds(30));
381 394
382 crypto_config_.SetDefaults(); 395 crypto_config_.SetDefaults();
383 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); 396 crypto_config_.AddCanonicalSuffix(".c.youtube.com");
384 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); 397 crypto_config_.AddCanonicalSuffix(".googlevideo.com");
385 crypto_config_.SetProofVerifier(new ProofVerifierChromium(cert_verifier)); 398 crypto_config_.SetProofVerifier(new ProofVerifierChromium(cert_verifier));
399 if (!IsEcdsaSupported())
400 crypto_config_.DisableEcdsa();
386 } 401 }
387 402
388 QuicStreamFactory::~QuicStreamFactory() { 403 QuicStreamFactory::~QuicStreamFactory() {
389 CloseAllSessions(ERR_ABORTED); 404 CloseAllSessions(ERR_ABORTED);
390 STLDeleteElements(&all_sessions_); 405 STLDeleteElements(&all_sessions_);
391 STLDeleteValues(&active_jobs_); 406 STLDeleteValues(&active_jobs_);
392 } 407 }
393 408
394 int QuicStreamFactory::Create(const HostPortPair& host_port_pair, 409 int QuicStreamFactory::Create(const HostPortPair& host_port_pair,
395 bool is_https, 410 bool is_https,
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 base::TimeTicks when = broken_alternate_protocol_list_.front().when; 807 base::TimeTicks when = broken_alternate_protocol_list_.front().when;
793 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); 808 base::TimeDelta delay = when > now ? when - now : base::TimeDelta();
794 base::MessageLoop::current()->PostDelayedTask( 809 base::MessageLoop::current()->PostDelayedTask(
795 FROM_HERE, 810 FROM_HERE,
796 base::Bind(&QuicStreamFactory::ExpireBrokenAlternateProtocolMappings, 811 base::Bind(&QuicStreamFactory::ExpireBrokenAlternateProtocolMappings,
797 weak_factory_.GetWeakPtr()), 812 weak_factory_.GetWeakPtr()),
798 delay); 813 delay);
799 } 814 }
800 815
801 } // namespace net 816 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698