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

Unified Diff: net/websockets/websocket_errors.h

Issue 10824081: Add WebSocketError to indicate decoding failure reason (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready for the next review Created 8 years, 5 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_frame_parser.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
new file mode 100644
index 0000000000000000000000000000000000000000..3c95facfa4706b8beceb8fb6801ed1a3466b39c0
--- /dev/null
+++ b/net/websockets/websocket_errors.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_WEBSOCKETS_WEBSOCKET_ERRORS_H_
+#define NET_WEBSOCKETS_WEBSOCKET_ERRORS_H_
+
+#include "net/base/net_errors.h"
+
+namespace net {
+
+// Error values for WebSocket framing.
+// This values are compatible to RFC6455 defined status codes.
+enum WebSocketError {
+ WEB_SOCKET_OK = 1000,
+ WEB_SOCKET_ERR_PROTOCOL_ERROR = 1002,
+ WEB_SOCKET_ERR_MESSAGE_TOO_BIG = 1009
+};
+
+// Convert WebSocketError to net::Error defined in net/base/net_errors.h.
+Error WebSocketErrorToNetError(WebSocketError error);
+
+} // namespace net
+
+#endif // NET_WEBSOCKETS_WEBSOCKET_FRAME_H_
« no previous file with comments | « no previous file | net/websockets/websocket_errors.cc » ('j') | net/websockets/websocket_frame_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698