OLD | NEW |
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 if (ContainsKey(all_crypto_configs_, host_port_proxy_pair)) { | 478 if (ContainsKey(all_crypto_configs_, host_port_proxy_pair)) { |
479 crypto_config = all_crypto_configs_[host_port_proxy_pair]; | 479 crypto_config = all_crypto_configs_[host_port_proxy_pair]; |
480 DCHECK(crypto_config); | 480 DCHECK(crypto_config); |
481 } else { | 481 } else { |
482 // TODO(rtenneti): if two quic_sessions for the same host_port_proxy_pair | 482 // TODO(rtenneti): if two quic_sessions for the same host_port_proxy_pair |
483 // share the same crypto_config, will it cause issues? | 483 // share the same crypto_config, will it cause issues? |
484 crypto_config = new QuicCryptoClientConfig(); | 484 crypto_config = new QuicCryptoClientConfig(); |
485 crypto_config->SetDefaults(); | 485 crypto_config->SetDefaults(); |
486 all_crypto_configs_[host_port_proxy_pair] = crypto_config; | 486 all_crypto_configs_[host_port_proxy_pair] = crypto_config; |
487 PopulateFromCanonicalConfig(host_port_proxy_pair, crypto_config); | 487 // TODO(rtenneti): Temporarily disabled using CanonicalConfig until we fix |
| 488 // performance problems. |
| 489 // PopulateFromCanonicalConfig(host_port_proxy_pair, crypto_config); |
488 } | 490 } |
489 return crypto_config; | 491 return crypto_config; |
490 } | 492 } |
491 | 493 |
492 void QuicStreamFactory::PopulateFromCanonicalConfig( | 494 void QuicStreamFactory::PopulateFromCanonicalConfig( |
493 const HostPortProxyPair& host_port_proxy_pair, | 495 const HostPortProxyPair& host_port_proxy_pair, |
494 QuicCryptoClientConfig* crypto_config) { | 496 QuicCryptoClientConfig* crypto_config) { |
495 const string server_hostname = host_port_proxy_pair.first.host(); | 497 const string server_hostname = host_port_proxy_pair.first.host(); |
496 const string kYouTubeSuffix(".c.youtube.com"); | 498 const string kYouTubeSuffix(".c.youtube.com"); |
497 if (!EndsWith(server_hostname, kYouTubeSuffix, false)) { | 499 if (!EndsWith(server_hostname, kYouTubeSuffix, false)) { |
(...skipping 17 matching lines...) Expand all Loading... |
515 DCHECK(canonical_crypto_config); | 517 DCHECK(canonical_crypto_config); |
516 | 518 |
517 // Copy the CachedState for the canonical server from canonical_crypto_config | 519 // Copy the CachedState for the canonical server from canonical_crypto_config |
518 // as the initial CachedState for the server_hostname in crypto_config. | 520 // as the initial CachedState for the server_hostname in crypto_config. |
519 crypto_config->InitializeFrom(server_hostname, | 521 crypto_config->InitializeFrom(server_hostname, |
520 canonical_host_port_proxy_pair.first.host(), | 522 canonical_host_port_proxy_pair.first.host(), |
521 canonical_crypto_config); | 523 canonical_crypto_config); |
522 } | 524 } |
523 | 525 |
524 } // namespace net | 526 } // namespace net |
OLD | NEW |