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

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: Fixes from tyoshino code review Created 7 years, 8 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') | net/websockets/websocket_errors.cc » ('J')
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..d6bf4e2f7c9303c56d506f2c50f15a756ea715c6 100644
--- a/net/websockets/websocket_errors.h
+++ b/net/websockets/websocket_errors.h
@@ -9,12 +9,49 @@
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,
+
+ // Codes starting with 3000 apply to the logical connection in the
+ // draft-ietf-hybi-websocket-multiplexing spec
+ kWebSocketErrorLogicalChannelFailed = 3000,
+ kWebSocketErrorSendQuotaViolation = 3005,
+ kWebSocketErrorSendQuotaOverflow = 3006,
+ kWebSocketErrorIdleTimeout = 3007,
+ kWebSocketErrorDropChannelAck = 3008,
+ kWebSocketErrorBadFragmentation = 3009,
tyoshino (SeeGerritForStatus) 2013/05/07 05:36:26 separate this block too. they're mux drop reason c
Adam Rice 2013/05/07 08:02:54 Sorry. I thought I had removed them, but I did not
+
+ // 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 +59,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') | net/websockets/websocket_errors.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698