Index: net/websockets/websocket_extension_parser.h |
diff --git a/net/websockets/websocket_extension_parser.h b/net/websockets/websocket_extension_parser.h |
index 6b2e4dc629873b50348d221283fe49d2afca5cc8..b78acce9245e3bb6bcbf92d11f76abbca77fd3d2 100644 |
--- a/net/websockets/websocket_extension_parser.h |
+++ b/net/websockets/websocket_extension_parser.h |
@@ -23,13 +23,13 @@ class NET_EXPORT_PRIVATE WebSocketExtensionParser { |
// |
// There must be no newline characters in the input. LWS-concatenation must |
// have already been done before calling this method. |
- void Parse(const char* data, size_t size); |
- void Parse(const std::string& data) { |
- Parse(data.data(), data.size()); |
+ // |
+ // Returns true if the method was successful (no syntax error was found). |
+ bool Parse(const char* data, size_t size); |
+ bool Parse(const std::string& data) { |
+ return Parse(data.data(), data.size()); |
} |
- // Returns true if the last Parse() method call encountered any syntax error. |
- bool has_error() const { return has_error_; } |
// Returns the result of the last Parse() method call. |
const std::vector<WebSocketExtension>& extensions() const { |
return extensions_; |
@@ -37,11 +37,11 @@ class NET_EXPORT_PRIVATE WebSocketExtensionParser { |
private: |
// TODO(tyoshino): Make the following methods return success/fail. |
eroman
2015/04/06 19:07:52
You can now remove this TODO
tyoshino (SeeGerritForStatus)
2015/04/13 14:11:59
Done.
|
- void Consume(char c); |
- void ConsumeExtension(WebSocketExtension* extension); |
- void ConsumeExtensionParameter(WebSocketExtension::Parameter* parameter); |
- void ConsumeToken(base::StringPiece* token); |
- void ConsumeQuotedToken(std::string* token); |
+ bool Consume(char c); |
eroman
2015/04/06 19:07:52
Something else you may consider is to add WARN_UNU
tyoshino (SeeGerritForStatus)
2015/04/13 14:11:59
Done.
|
+ bool ConsumeExtension(WebSocketExtension* extension); |
+ bool ConsumeExtensionParameter(WebSocketExtension::Parameter* parameter); |
+ bool ConsumeToken(base::StringPiece* token); |
+ bool ConsumeQuotedToken(std::string* token); |
void ConsumeSpaces(); |
bool Lookahead(char c); |
bool ConsumeIfMatch(char c); |
@@ -54,7 +54,6 @@ class NET_EXPORT_PRIVATE WebSocketExtensionParser { |
const char* current_; |
// The pointer of the end of the input string. |
const char* end_; |
- bool has_error_; |
std::vector<WebSocketExtension> extensions_; |
DISALLOW_COPY_AND_ASSIGN(WebSocketExtensionParser); |