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/core/quic_crypto_stream.h" | 5 #include "net/quic/core/quic_crypto_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
10 #include "net/quic/core/crypto/crypto_handshake.h" | 10 #include "net/quic/core/crypto/crypto_handshake.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 QuicCryptoStream::QuicCryptoStream(QuicSession* session) | 27 QuicCryptoStream::QuicCryptoStream(QuicSession* session) |
28 : ReliableQuicStream(kCryptoStreamId, session), | 28 : ReliableQuicStream(kCryptoStreamId, session), |
29 encryption_established_(false), | 29 encryption_established_(false), |
30 handshake_confirmed_(false) { | 30 handshake_confirmed_(false) { |
31 crypto_framer_.set_visitor(this); | 31 crypto_framer_.set_visitor(this); |
32 // The crypto stream is exempt from connection level flow control. | 32 // The crypto stream is exempt from connection level flow control. |
33 DisableConnectionFlowControlForThisStream(); | 33 DisableConnectionFlowControlForThisStream(); |
34 } | 34 } |
35 | 35 |
| 36 // static |
| 37 QuicByteCount QuicCryptoStream::CryptoMessageFramingOverhead( |
| 38 QuicVersion version) { |
| 39 return QuicPacketCreator::StreamFramePacketOverhead( |
| 40 version, PACKET_8BYTE_CONNECTION_ID, |
| 41 /*include_version=*/true, |
| 42 /*include_path_id=*/true, |
| 43 /*include_diversification_nonce=*/true, PACKET_1BYTE_PACKET_NUMBER, |
| 44 /*offset=*/0); |
| 45 } |
| 46 |
36 void QuicCryptoStream::OnError(CryptoFramer* framer) { | 47 void QuicCryptoStream::OnError(CryptoFramer* framer) { |
37 DLOG(WARNING) << "Error processing crypto data: " | 48 DLOG(WARNING) << "Error processing crypto data: " |
38 << QuicUtils::ErrorToString(framer->error()); | 49 << QuicUtils::ErrorToString(framer->error()); |
39 } | 50 } |
40 | 51 |
41 void QuicCryptoStream::OnHandshakeMessage( | 52 void QuicCryptoStream::OnHandshakeMessage( |
42 const CryptoHandshakeMessage& message) { | 53 const CryptoHandshakeMessage& message) { |
43 DVLOG(1) << ENDPOINT << "Received " << message.DebugString(); | 54 DVLOG(1) << ENDPOINT << "Received " << message.DebugString(); |
44 session()->OnCryptoHandshakeMessageReceived(message); | 55 session()->OnCryptoHandshakeMessageReceived(message); |
45 } | 56 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 crypto_negotiated_params_.initial_subkey_secret, "EXPORTER-Token-Binding", | 107 crypto_negotiated_params_.initial_subkey_secret, "EXPORTER-Token-Binding", |
97 /* context= */ "", 32, result); | 108 /* context= */ "", 32, result); |
98 } | 109 } |
99 | 110 |
100 const QuicCryptoNegotiatedParameters& | 111 const QuicCryptoNegotiatedParameters& |
101 QuicCryptoStream::crypto_negotiated_params() const { | 112 QuicCryptoStream::crypto_negotiated_params() const { |
102 return crypto_negotiated_params_; | 113 return crypto_negotiated_params_; |
103 } | 114 } |
104 | 115 |
105 } // namespace net | 116 } // namespace net |
OLD | NEW |