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

Unified Diff: net/websockets/websocket_errors.h

Issue 14850012: Add missing status codes to WebSocketError enum. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove other mux status codes. Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/websockets/websocket_errors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_errors.h
diff --git a/net/websockets/websocket_errors.h b/net/websockets/websocket_errors.h
index 35d2462cea23aa27c20b0b22f06846b29ab2a5b6..7d62cc008e2578554d4d2a2de978c124c18e2175 100644
--- a/net/websockets/websocket_errors.h
+++ b/net/websockets/websocket_errors.h
@@ -9,12 +9,40 @@
namespace net {
-// Error values for WebSocket framing.
-// This values are compatible to RFC6455 defined status codes.
+// Reason codes used with close messages. NoStatusReceived,
+// AbnormalClosure and TlsHandshake are special in that they
+// should never be sent on the wire; they are only used within the
+// implementation.
enum WebSocketError {
- WEB_SOCKET_OK = 1000,
- WEB_SOCKET_ERR_PROTOCOL_ERROR = 1002,
- WEB_SOCKET_ERR_MESSAGE_TOO_BIG = 1009
+ // Status codes in the range 0 to 999 are not used.
+
+ // The following are defined by RFC6455.
+ kWebSocketNormalClosure = 1000,
+ kWebSocketErrorGoingAway = 1001,
+ kWebSocketErrorProtocolError = 1002,
+ kWebSocketErrorUnsupportedData = 1003,
+ kWebSocketErrorNoStatusReceived = 1005,
+ kWebSocketErrorAbnormalClosure = 1006,
+ kWebSocketErrorInvalidFramePayloadData = 1007,
+ kWebSocketErrorPolicyViolation = 1008,
+ kWebSocketErrorMessageTooBig = 1009,
+ kWebSocketErrorMandatoryExtension = 1010,
+ kWebSocketErrorInternalServerError = 1011,
+ kWebSocketErrorTlsHandshake = 1015,
+
+ // The range 1000-2999 is reserved by RFC6455 for use by the WebSocket
+ // protocol and public extensions.
+ kWebSocketErrorProtocolReservedMax = 2999,
+
+ // The range 3000-3999 is reserved by RFC6455 for registered use by libraries,
+ // frameworks and applications.
+ kWebSocketErrorRegisteredReservedMin = 3000,
+ kWebSocketErrorRegisteredReservedMax = 3999,
+
+ // The range 4000-4999 is reserved by RFC6455 for private use by prior
+ // agreement of the endpoints.
+ kWebSocketErrorPrivateReservedMin = 4000,
+ kWebSocketErrorPrivateReservedMax = 4999,
};
// Convert WebSocketError to net::Error defined in net/base/net_errors.h.
@@ -22,4 +50,4 @@ NET_EXPORT_PRIVATE Error WebSocketErrorToNetError(WebSocketError error);
} // namespace net
-#endif // NET_WEBSOCKETS_WEBSOCKET_FRAME_H_
+#endif // NET_WEBSOCKETS_WEBSOCKET_ERRORS_H_
« no previous file with comments | « no previous file | net/websockets/websocket_errors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698