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

Side by Side Diff: net/quic/chromium/quic_chromium_client_session.cc

Issue 2766603004: QUIC: mark QUIC handshake failed if connection is closed after CryptoConnect (Closed)
Patch Set: address xunjieli's comments Created 3 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
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/chromium/quic_chromium_client_session.h" 5 #include "net/quic/chromium/quic_chromium_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 return OK; 663 return OK;
664 } 664 }
665 665
666 int QuicChromiumClientSession::CryptoConnect( 666 int QuicChromiumClientSession::CryptoConnect(
667 const CompletionCallback& callback) { 667 const CompletionCallback& callback) {
668 connect_timing_.connect_start = base::TimeTicks::Now(); 668 connect_timing_.connect_start = base::TimeTicks::Now();
669 RecordHandshakeState(STATE_STARTED); 669 RecordHandshakeState(STATE_STARTED);
670 DCHECK(flow_controller()); 670 DCHECK(flow_controller());
671 crypto_stream_->CryptoConnect(); 671 crypto_stream_->CryptoConnect();
672 672
673 // Check if the connection is still open, issues during CryptoConnect like
674 // packet write error could cause the connection to be torn down. Return
675 // synchronously with ERR_QUIC_HANDSHAKE_FAILED so that QuicStreamFactory::Job
xunjieli 2017/03/23 17:43:37 mentioning QuicStreamFacory::Job here is a layerin
Zhongyi Shi 2017/03/23 19:20:32 QuicCryptoClientStream::CryptoConnect() is shared
676 // could fail without hanging.
677 if (!connection()->connected())
678 return ERR_QUIC_HANDSHAKE_FAILED;
679
673 if (IsCryptoHandshakeConfirmed()) { 680 if (IsCryptoHandshakeConfirmed()) {
674 connect_timing_.connect_end = base::TimeTicks::Now(); 681 connect_timing_.connect_end = base::TimeTicks::Now();
675 return OK; 682 return OK;
676 } 683 }
677 684
678 // Unless we require handshake confirmation, activate the session if 685 // Unless we require handshake confirmation, activate the session if
679 // we have established initial encryption. 686 // we have established initial encryption.
680 if (!require_confirmation_ && IsEncryptionEstablished()) 687 if (!require_confirmation_ && IsEncryptionEstablished())
681 return OK; 688 return OK;
682 689
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 } 1527 }
1521 1528
1522 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { 1529 size_t QuicChromiumClientSession::EstimateMemoryUsage() const {
1523 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's 1530 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's
1524 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and 1531 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and
1525 // unacked packet map. 1532 // unacked packet map.
1526 return base::trace_event::EstimateMemoryUsage(packet_readers_); 1533 return base::trace_event::EstimateMemoryUsage(packet_readers_);
1527 } 1534 }
1528 1535
1529 } // namespace net 1536 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/mock_crypto_client_stream_factory.cc ('k') | net/quic/chromium/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698