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

Side by Side Diff: net/spdy/spdy_headers_block_parser.h

Issue 867273002: Change OK to NO_PARSER_ERROR in enum ParserError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add undef. Created 5 years, 11 months 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/spdy/spdy_headers_block_parser.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ 5 #ifndef NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_
6 #define NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ 6 #define NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 virtual ~SpdyHeadersBlockParser(); 54 virtual ~SpdyHeadersBlockParser();
55 55
56 // Handles headers block data as it arrives. Returns false if an error has 56 // Handles headers block data as it arrives. Returns false if an error has
57 // been set, which can include the recoverable error NEED_MORE_DATA. Returns 57 // been set, which can include the recoverable error NEED_MORE_DATA. Returns
58 // true if the invocation completes the parse of the entire headers block, 58 // true if the invocation completes the parse of the entire headers block,
59 // in which case the parser is ready for a new headers block. 59 // in which case the parser is ready for a new headers block.
60 bool HandleControlFrameHeadersData(SpdyStreamId stream_id, 60 bool HandleControlFrameHeadersData(SpdyStreamId stream_id,
61 const char* headers_data, 61 const char* headers_data,
62 size_t len); 62 size_t len);
63 enum ParserError { 63 enum ParserError {
64 OK, 64 #if defined(_WIN32)
65 // On Windows, <WinError.h> defines the NO_ERROR macro as 0L, which
66 // breaks the compilation of the "NO_ERROR = 0" line.
67 #undef NO_ERROR
68 #endif
69 NO_ERROR,
Ryan Hamilton 2015/01/26 03:51:23 Since this is a bit ugly, consider renaming this t
Bence 2015/01/26 16:48:21 Done.
65 // Set when parsing failed due to insufficient data. 70 // Set when parsing failed due to insufficient data.
66 // This error is recoverable, by passing in new data. 71 // This error is recoverable, by passing in new data.
67 NEED_MORE_DATA, 72 NEED_MORE_DATA,
68 // Set when a complete block has been read, but unprocessed data remains. 73 // Set when a complete block has been read, but unprocessed data remains.
69 TOO_MUCH_DATA, 74 TOO_MUCH_DATA,
70 // Set when a block exceeds |MaxNumberOfHeadersForVersion| headers. 75 // Set when a block exceeds |MaxNumberOfHeadersForVersion| headers.
71 HEADER_BLOCK_TOO_LARGE, 76 HEADER_BLOCK_TOO_LARGE,
72 // Set when a header key or value exceeds |kMaximumFieldLength|. 77 // Set when a header key or value exceeds |kMaximumFieldLength|.
73 HEADER_FIELD_TOO_LARGE, 78 HEADER_FIELD_TOO_LARGE,
74 // Set when the parser is given an unexpected stream ID. 79 // Set when the parser is given an unexpected stream ID.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 SpdyStreamId stream_id_; 143 SpdyStreamId stream_id_;
139 144
140 ParserError error_; 145 ParserError error_;
141 146
142 const SpdyMajorVersion spdy_version_; 147 const SpdyMajorVersion spdy_version_;
143 }; 148 };
144 149
145 } // namespace net 150 } // namespace net
146 151
147 #endif // NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_ 152 #endif // NET_SPDY_SPDY_HEADERS_BLOCK_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_headers_block_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698