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

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

Issue 127113003: Do not delete a QuicSession in StartReading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698