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/quic_crypto_stream.h" | 5 #include "net/quic/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/crypto/crypto_handshake.h" | 10 #include "net/quic/crypto/crypto_handshake.h" |
11 #include "net/quic/crypto/crypto_utils.h" | 11 #include "net/quic/crypto/crypto_utils.h" |
12 #include "net/quic/quic_connection.h" | 12 #include "net/quic/quic_connection.h" |
13 #include "net/quic/quic_session.h" | 13 #include "net/quic/quic_session.h" |
14 #include "net/quic/quic_utils.h" | 14 #include "net/quic/quic_utils.h" |
15 | 15 |
16 using std::string; | 16 using std::string; |
17 using base::StringPiece; | 17 using base::StringPiece; |
| 18 using net::SpdyPriority; |
18 | 19 |
19 namespace net { | 20 namespace net { |
20 | 21 |
21 #define ENDPOINT \ | 22 #define ENDPOINT \ |
22 (session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client:" \ | 23 (session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client:" \ |
23 " ") | 24 " ") |
24 | 25 |
25 QuicCryptoStream::QuicCryptoStream(QuicSession* session) | 26 QuicCryptoStream::QuicCryptoStream(QuicSession* session) |
26 : ReliableQuicStream(kCryptoStreamId, session), | 27 : ReliableQuicStream(kCryptoStreamId, session), |
27 encryption_established_(false), | 28 encryption_established_(false), |
(...skipping 23 matching lines...) Expand all Loading... |
51 } | 52 } |
52 StringPiece data(static_cast<char*>(iov.iov_base), iov.iov_len); | 53 StringPiece data(static_cast<char*>(iov.iov_base), iov.iov_len); |
53 if (!crypto_framer_.ProcessInput(data)) { | 54 if (!crypto_framer_.ProcessInput(data)) { |
54 CloseConnection(crypto_framer_.error()); | 55 CloseConnection(crypto_framer_.error()); |
55 return; | 56 return; |
56 } | 57 } |
57 sequencer()->MarkConsumed(iov.iov_len); | 58 sequencer()->MarkConsumed(iov.iov_len); |
58 } | 59 } |
59 } | 60 } |
60 | 61 |
61 QuicPriority QuicCryptoStream::Priority() const { | 62 SpdyPriority QuicCryptoStream::Priority() const { |
62 return QuicUtils::HighestPriority(); | 63 return net::kHighestPriority; // The smallest priority is also the highest |
63 } | 64 } |
64 | 65 |
65 void QuicCryptoStream::SendHandshakeMessage( | 66 void QuicCryptoStream::SendHandshakeMessage( |
66 const CryptoHandshakeMessage& message) { | 67 const CryptoHandshakeMessage& message) { |
67 SendHandshakeMessage(message, nullptr); | 68 SendHandshakeMessage(message, nullptr); |
68 } | 69 } |
69 | 70 |
70 void QuicCryptoStream::SendHandshakeMessage( | 71 void QuicCryptoStream::SendHandshakeMessage( |
71 const CryptoHandshakeMessage& message, | 72 const CryptoHandshakeMessage& message, |
72 QuicAckListenerInterface* listener) { | 73 QuicAckListenerInterface* listener) { |
(...skipping 21 matching lines...) Expand all Loading... |
94 result_len, | 95 result_len, |
95 result); | 96 result); |
96 } | 97 } |
97 | 98 |
98 const QuicCryptoNegotiatedParameters& | 99 const QuicCryptoNegotiatedParameters& |
99 QuicCryptoStream::crypto_negotiated_params() const { | 100 QuicCryptoStream::crypto_negotiated_params() const { |
100 return crypto_negotiated_params_; | 101 return crypto_negotiated_params_; |
101 } | 102 } |
102 | 103 |
103 } // namespace net | 104 } // namespace net |
OLD | NEW |