| 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 // Check if the connection is still open, issues during CryptoConnect like |
| 674 // packet write error could cause the connection to be torn down. |
| 675 if (!connection()->connected()) |
| 676 return ERR_QUIC_HANDSHAKE_FAILED; |
| 677 |
| 673 if (IsCryptoHandshakeConfirmed()) { | 678 if (IsCryptoHandshakeConfirmed()) { |
| 674 connect_timing_.connect_end = base::TimeTicks::Now(); | 679 connect_timing_.connect_end = base::TimeTicks::Now(); |
| 675 return OK; | 680 return OK; |
| 676 } | 681 } |
| 677 | 682 |
| 678 // Unless we require handshake confirmation, activate the session if | 683 // Unless we require handshake confirmation, activate the session if |
| 679 // we have established initial encryption. | 684 // we have established initial encryption. |
| 680 if (!require_confirmation_ && IsEncryptionEstablished()) | 685 if (!require_confirmation_ && IsEncryptionEstablished()) |
| 681 return OK; | 686 return OK; |
| 682 | 687 |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 } | 1525 } |
| 1521 | 1526 |
| 1522 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { | 1527 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { |
| 1523 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's | 1528 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's |
| 1524 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and | 1529 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and |
| 1525 // unacked packet map. | 1530 // unacked packet map. |
| 1526 return base::trace_event::EstimateMemoryUsage(packet_readers_); | 1531 return base::trace_event::EstimateMemoryUsage(packet_readers_); |
| 1527 } | 1532 } |
| 1528 | 1533 |
| 1529 } // namespace net | 1534 } // namespace net |
| OLD | NEW |