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

Unified Diff: net/websockets/websocket_channel.h

Issue 157033013: Check for invalid use of data frame opcodes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove |expecting_continuation| parameter from HandleDataFrame() Created 6 years, 10 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_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_channel.h
diff --git a/net/websockets/websocket_channel.h b/net/websockets/websocket_channel.h
index 18734cae677bf9b840d8d2255d02d809a634232d..13fa7c70b58e7279513f62c3ae770b5016a89f6c 100644
--- a/net/websockets/websocket_channel.h
+++ b/net/websockets/websocket_channel.h
@@ -200,6 +200,14 @@ class NET_EXPORT WebSocketChannel {
const scoped_refptr<IOBuffer>& data_buffer,
size_t size) WARN_UNUSED_RESULT;
+ // Forward a received data frame to the renderer, if connected. If
+ // |expecting_continuation| is not equal to |expecting_to_read_continuation_|,
+ // will fail the channel. Also checks the UTF-8 validity of text frames.
+ ChannelState HandleDataFrame(const WebSocketFrameHeader::OpCode opcode,
+ bool final,
+ const scoped_refptr<IOBuffer>& data_buffer,
+ size_t size);
+
// Low-level method to send a single frame. Used for both data and control
// frames. Either sends the frame immediately or buffers it to be scheduled
// when the current write finishes. |fin| and |op_code| are defined as for
@@ -319,6 +327,9 @@ class NET_EXPORT WebSocketChannel {
base::StreamingUtf8Validator incoming_utf8_validator_;
bool receiving_text_message_;
+ // True if we are in the middle of receiving a message.
+ bool expecting_to_handle_continuation_;
+
DISALLOW_COPY_AND_ASSIGN(WebSocketChannel);
};
« no previous file with comments | « no previous file | net/websockets/websocket_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698