websocket_errors.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "net/websocket/websocket_errors.h"
6
7namespace net {
8
9Error WebSocketErrorToNetError(WebSocketError error) {
10  switch (error) {
11    case WEB_SOCKET_OK:
12      return OK;
13    case WEB_SOCKET_ERR_PROTOCOL_ERROR:
14      return ERR_WS_PROTOCOL_ERROR;
15    case WEB_SOCKET_ERR_MESSAGE_TOO_BIG:
16      return ERR_MSG_TOO_BIG;
17    default:
18      NOTREACHED();
19  }
20}
21
22}  // namespace net
23
24#endif  // NET_WEBSOCKETS_WEBSOCKET_FRAME_H_
25