| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 int rv = factory_->CreateSession(host_port_proxy_pair_, is_https_, | 234 int rv = factory_->CreateSession(host_port_proxy_pair_, is_https_, |
| 235 cert_verifier_, address_list_, net_log_, &session_); | 235 cert_verifier_, address_list_, net_log_, &session_); |
| 236 if (rv != OK) { | 236 if (rv != OK) { |
| 237 DCHECK(rv != ERR_IO_PENDING); | 237 DCHECK(rv != ERR_IO_PENDING); |
| 238 DCHECK(!session_); | 238 DCHECK(!session_); |
| 239 return rv; | 239 return rv; |
| 240 } | 240 } |
| 241 | 241 |
| 242 session_->StartReading(); | 242 session_->StartReading(); |
| 243 if (!session_->connection()->connected()) { |
| 244 return ERR_QUIC_PROTOCOL_ERROR; |
| 245 } |
| 243 rv = session_->CryptoConnect( | 246 rv = session_->CryptoConnect( |
| 244 factory_->require_confirmation() || is_https_, | 247 factory_->require_confirmation() || is_https_, |
| 245 base::Bind(&QuicStreamFactory::Job::OnIOComplete, | 248 base::Bind(&QuicStreamFactory::Job::OnIOComplete, |
| 246 base::Unretained(this))); | 249 base::Unretained(this))); |
| 247 return rv; | 250 return rv; |
| 248 } | 251 } |
| 249 | 252 |
| 250 int QuicStreamFactory::Job::DoConnectComplete(int rv) { | 253 int QuicStreamFactory::Job::DoConnectComplete(int rv) { |
| 251 if (rv != OK) | 254 if (rv != OK) |
| 252 return rv; | 255 return rv; |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 // Copy the CachedState for the canonical server from canonical_crypto_config | 635 // Copy the CachedState for the canonical server from canonical_crypto_config |
| 633 // as the initial CachedState for the server_hostname in crypto_config. | 636 // as the initial CachedState for the server_hostname in crypto_config. |
| 634 crypto_config->InitializeFrom(server_hostname, | 637 crypto_config->InitializeFrom(server_hostname, |
| 635 canonical_host_port_proxy_pair.first.host(), | 638 canonical_host_port_proxy_pair.first.host(), |
| 636 canonical_crypto_config); | 639 canonical_crypto_config); |
| 637 // Update canonical version to point at the "most recent" crypto_config. | 640 // Update canonical version to point at the "most recent" crypto_config. |
| 638 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair; | 641 canonical_hostname_to_origin_map_[canonical_host_port] = host_port_proxy_pair; |
| 639 } | 642 } |
| 640 | 643 |
| 641 } // namespace net | 644 } // namespace net |
| OLD | NEW |