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

Unified Diff: net/websockets/websocket_errors.cc

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 | « net/websockets/websocket_errors.h ('k') | net/websockets/websocket_errors_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_errors.cc
diff --git a/net/websockets/websocket_errors.cc b/net/websockets/websocket_errors.cc
index 0814dab4aeedd5ec9e60ff5397a7c7600a4738c3..b7ca7bc563679a4f15aa94fe44a29a3da458af56 100644
--- a/net/websockets/websocket_errors.cc
+++ b/net/websockets/websocket_errors.cc
@@ -10,14 +10,31 @@ namespace net {
Error WebSocketErrorToNetError(WebSocketError error) {
switch (error) {
- case WEB_SOCKET_OK:
+ case kWebSocketNormalClosure:
return OK;
- case WEB_SOCKET_ERR_PROTOCOL_ERROR:
+
+ case kWebSocketErrorGoingAway: // TODO(ricea): More specific code?
+ case kWebSocketErrorProtocolError:
+ case kWebSocketErrorUnsupportedData:
+ case kWebSocketErrorInvalidFramePayloadData:
+ case kWebSocketErrorPolicyViolation:
+ case kWebSocketErrorMandatoryExtension:
+ case kWebSocketErrorInternalServerError:
return ERR_WS_PROTOCOL_ERROR;
- case WEB_SOCKET_ERR_MESSAGE_TOO_BIG:
+
+ case kWebSocketErrorNoStatusReceived:
+ case kWebSocketErrorAbnormalClosure:
+ return ERR_CONNECTION_CLOSED;
+
+ case kWebSocketErrorTlsHandshake:
+ // This error will probably be reported with more detail at a lower layer;
+ // this is the best we can do at this layer.
+ return ERR_SSL_PROTOCOL_ERROR;
+
+ case kWebSocketErrorMessageTooBig:
return ERR_MSG_TOO_BIG;
+
default:
- NOTREACHED();
return ERR_UNEXPECTED;
}
}
« no previous file with comments | « net/websockets/websocket_errors.h ('k') | net/websockets/websocket_errors_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698