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

Side by Side Diff: net/websockets/websocket_extension_parser.h

Issue 2344873002: WebSocketExtensionParser: reject top-bit-set characters (Closed)
Patch Set: Include logging.h, remove string_util.h Created 4 years, 3 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/websockets/websocket_extension_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_ 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_ 6 #define NET_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 private: 42 private:
43 WARN_UNUSED_RESULT bool Consume(char c); 43 WARN_UNUSED_RESULT bool Consume(char c);
44 WARN_UNUSED_RESULT bool ConsumeExtension(WebSocketExtension* extension); 44 WARN_UNUSED_RESULT bool ConsumeExtension(WebSocketExtension* extension);
45 WARN_UNUSED_RESULT bool ConsumeExtensionParameter( 45 WARN_UNUSED_RESULT bool ConsumeExtensionParameter(
46 WebSocketExtension::Parameter* parameter); 46 WebSocketExtension::Parameter* parameter);
47 WARN_UNUSED_RESULT bool ConsumeToken(base::StringPiece* token); 47 WARN_UNUSED_RESULT bool ConsumeToken(base::StringPiece* token);
48 WARN_UNUSED_RESULT bool ConsumeQuotedToken(std::string* token); 48 WARN_UNUSED_RESULT bool ConsumeQuotedToken(std::string* token);
49 void ConsumeSpaces(); 49 void ConsumeSpaces();
50 WARN_UNUSED_RESULT bool Lookahead(char c); 50 WARN_UNUSED_RESULT bool Lookahead(char c);
51 WARN_UNUSED_RESULT bool ConsumeIfMatch(char c); 51 WARN_UNUSED_RESULT bool ConsumeIfMatch(char c);
52 size_t UnconsumedBytes() const { return end_ - current_; }
53
54 static bool IsControl(char c);
55 static bool IsSeparator(char c);
56 52
57 // The current position in the input string. 53 // The current position in the input string.
58 const char* current_; 54 const char* current_;
59 // The pointer of the end of the input string. 55 // The pointer of the end of the input string.
60 const char* end_; 56 const char* end_;
61 std::vector<WebSocketExtension> extensions_; 57 std::vector<WebSocketExtension> extensions_;
62 58
63 DISALLOW_COPY_AND_ASSIGN(WebSocketExtensionParser); 59 DISALLOW_COPY_AND_ASSIGN(WebSocketExtensionParser);
64 }; 60 };
65 61
66 } // namespace net 62 } // namespace net
67 63
68 #endif // NET_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_ 64 #endif // NET_WEBSOCKETS_WEBSOCKET_EXTENSION_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | net/websockets/websocket_extension_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698