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

Side by Side Diff: net/quic/crypto/crypto_framer.h

Issue 1548783002: Adding details to most quic connection close calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110540464
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | net/quic/crypto/crypto_framer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_ 5 #ifndef NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_
6 #define NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_ 6 #define NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Set callbacks to be called from the framer. A visitor must be set, or 49 // Set callbacks to be called from the framer. A visitor must be set, or
50 // else the framer will crash. It is acceptable for the visitor to do 50 // else the framer will crash. It is acceptable for the visitor to do
51 // nothing. If this is called multiple times, only the last visitor 51 // nothing. If this is called multiple times, only the last visitor
52 // will be used. |visitor| will be owned by the framer. 52 // will be used. |visitor| will be owned by the framer.
53 void set_visitor(CryptoFramerVisitorInterface* visitor) { 53 void set_visitor(CryptoFramerVisitorInterface* visitor) {
54 visitor_ = visitor; 54 visitor_ = visitor;
55 } 55 }
56 56
57 QuicErrorCode error() const { return error_; } 57 QuicErrorCode error() const { return error_; }
58 const std::string& error_detail() const { return error_detail_; }
58 59
59 // Processes input data, which must be delivered in order. Returns 60 // Processes input data, which must be delivered in order. Returns
60 // false if there was an error, and true otherwise. 61 // false if there was an error, and true otherwise.
61 bool ProcessInput(base::StringPiece input); 62 bool ProcessInput(base::StringPiece input);
62 63
63 // Returns the number of bytes of buffered input data remaining to be 64 // Returns the number of bytes of buffered input data remaining to be
64 // parsed. 65 // parsed.
65 size_t InputBytesRemaining() const { return buffer_.length(); } 66 size_t InputBytesRemaining() const { return buffer_.length(); }
66 67
67 // Returns a new QuicData owned by the caller that contains a serialized 68 // Returns a new QuicData owned by the caller that contains a serialized
(...skipping 24 matching lines...) Expand all
92 // Visitor to invoke when messages are parsed. 93 // Visitor to invoke when messages are parsed.
93 CryptoFramerVisitorInterface* visitor_; 94 CryptoFramerVisitorInterface* visitor_;
94 // Last error. 95 // Last error.
95 QuicErrorCode error_; 96 QuicErrorCode error_;
96 // Remaining unparsed data. 97 // Remaining unparsed data.
97 std::string buffer_; 98 std::string buffer_;
98 // Current state of the parsing. 99 // Current state of the parsing.
99 CryptoFramerState state_; 100 CryptoFramerState state_;
100 // The message currently being parsed. 101 // The message currently being parsed.
101 CryptoHandshakeMessage message_; 102 CryptoHandshakeMessage message_;
103 // The issue which caused |error_|
104 std::string error_detail_;
102 // Number of entires in the message currently being parsed. 105 // Number of entires in the message currently being parsed.
103 uint16 num_entries_; 106 uint16 num_entries_;
104 // tags_and_lengths_ contains the tags that are currently being parsed and 107 // tags_and_lengths_ contains the tags that are currently being parsed and
105 // their lengths. 108 // their lengths.
106 std::vector<std::pair<QuicTag, size_t>> tags_and_lengths_; 109 std::vector<std::pair<QuicTag, size_t>> tags_and_lengths_;
107 // Cumulative length of all values in the message currently being parsed. 110 // Cumulative length of all values in the message currently being parsed.
108 size_t values_len_; 111 size_t values_len_;
109 }; 112 };
110 113
111 } // namespace net 114 } // namespace net
112 115
113 #endif // NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_ 116 #endif // NET_QUIC_CRYPTO_CRYPTO_FRAMER_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/crypto/crypto_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698