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

Unified Diff: net/websockets/websocket_channel.h

Issue 131333010: Rename closing_* in WebSocketChannel to received_close_ and do some refactoring (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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..c5c67bf50b5412457986b805f3abaf3cf644d567 100644
--- a/net/websockets/websocket_channel.h
+++ b/net/websockets/websocket_channel.h
@@ -188,17 +188,23 @@ class NET_EXPORT WebSocketChannel {
// within the ReadFrames() loop and does not need to call ReadFrames() itself.
ChannelState OnReadDone(bool synchronous, int result) WARN_UNUSED_RESULT;
- // Processes a single frame that has been read from the stream.
- ChannelState ProcessFrame(
+ // Handles a single frame that the object has received enough of to process.
+ // May call |event_interface_| methods, send responses to the server, and
+ // change the value of |state_|.
+ //
+ // This method performs sanity checks on the frame that are needed regardless
+ // of the current state. Then, calls the HandleFrameByState() method below
+ // which performs the appropriate action(s) depending on the current state.
+ ChannelState HandleFrame(
scoped_ptr<WebSocketFrame> frame) WARN_UNUSED_RESULT;
- // Handles a frame that the object has received enough of to process. May call
- // |event_interface_| methods, send responses to the server, and change the
- // value of |state_|.
- ChannelState HandleFrame(const WebSocketFrameHeader::OpCode opcode,
- bool final,
- const scoped_refptr<IOBuffer>& data_buffer,
- size_t size) WARN_UNUSED_RESULT;
+ // Handles a single frame depending on the current state. It's used by the
+ // HandleFrame() method.
+ ChannelState HandleFrameByState(
+ const WebSocketFrameHeader::OpCode opcode,
+ bool final,
+ const scoped_refptr<IOBuffer>& data_buffer,
+ size_t size) WARN_UNUSED_RESULT;
// 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
@@ -301,8 +307,8 @@ class NET_EXPORT WebSocketChannel {
// Storage for the status code and reason from the time the Close frame
// arrives until the connection is closed and they are passed to
// OnDropChannel().
- uint16 closing_code_;
- std::string closing_reason_;
+ uint16 received_close_code_;
+ std::string received_close_reason_;
// The current state of the channel. Mainly used for sanity checking, but also
// used to track the close state.
« 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