Chromium Code Reviews| 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(); |
|
tyoshino (SeeGerritForStatus)
2013/05/07 05:36:26
can we keep NOTREACHED()? will this function start
Adam Rice
2013/05/07 08:02:54
I am not sure, but it seems likely we will want to
|
| return ERR_UNEXPECTED; |
| } |
| } |