Chromium Code Reviews| 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/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 Loading... | |
| 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 if (!connection()->connected()) | |
|
xunjieli
2017/03/23 16:18:02
nit: Maybe add a comment here explaining why we ne
Zhongyi Shi
2017/03/23 17:28:50
Done.
| |
| 674 return ERR_QUIC_HANDSHAKE_FAILED; | |
| 675 | |
| 673 if (IsCryptoHandshakeConfirmed()) { | 676 if (IsCryptoHandshakeConfirmed()) { |
| 674 connect_timing_.connect_end = base::TimeTicks::Now(); | 677 connect_timing_.connect_end = base::TimeTicks::Now(); |
| 675 return OK; | 678 return OK; |
| 676 } | 679 } |
| 677 | 680 |
| 678 // Unless we require handshake confirmation, activate the session if | 681 // Unless we require handshake confirmation, activate the session if |
| 679 // we have established initial encryption. | 682 // we have established initial encryption. |
| 680 if (!require_confirmation_ && IsEncryptionEstablished()) | 683 if (!require_confirmation_ && IsEncryptionEstablished()) |
| 681 return OK; | 684 return OK; |
| 682 | 685 |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1520 } | 1523 } |
| 1521 | 1524 |
| 1522 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { | 1525 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { |
| 1523 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's | 1526 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's |
| 1524 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and | 1527 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and |
| 1525 // unacked packet map. | 1528 // unacked packet map. |
| 1526 return base::trace_event::EstimateMemoryUsage(packet_readers_); | 1529 return base::trace_event::EstimateMemoryUsage(packet_readers_); |
| 1527 } | 1530 } |
| 1528 | 1531 |
| 1529 } // namespace net | 1532 } // namespace net |
| OLD | NEW |