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

Side by Side Diff: net/websockets/websocket_channel.h

Issue 105833003: Fail WebSocket channel when handshake fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « net/websockets/websocket_basic_handshake_stream.cc ('k') | net/websockets/websocket_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ 6 #define NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const std::vector<std::string>& requested_protocols, 146 const std::vector<std::string>& requested_protocols,
147 const GURL& origin, 147 const GURL& origin,
148 const WebSocketStreamCreator& creator); 148 const WebSocketStreamCreator& creator);
149 149
150 // Success callback from WebSocketStream::CreateAndConnectStream(). Reports 150 // Success callback from WebSocketStream::CreateAndConnectStream(). Reports
151 // success to the event interface. May delete |this|. 151 // success to the event interface. May delete |this|.
152 void OnConnectSuccess(scoped_ptr<WebSocketStream> stream); 152 void OnConnectSuccess(scoped_ptr<WebSocketStream> stream);
153 153
154 // Failure callback from WebSocketStream::CreateAndConnectStream(). Reports 154 // Failure callback from WebSocketStream::CreateAndConnectStream(). Reports
155 // failure to the event interface. May delete |this|. 155 // failure to the event interface. May delete |this|.
156 void OnConnectFailure(uint16 websocket_error); 156 void OnConnectFailure(const std::string& message);
157 157
158 // Returns true if state_ is SEND_CLOSED, CLOSE_WAIT or CLOSED. 158 // Returns true if state_ is SEND_CLOSED, CLOSE_WAIT or CLOSED.
159 bool InClosingState() const; 159 bool InClosingState() const;
160 160
161 // Calls WebSocketStream::WriteFrames() with the appropriate arguments 161 // Calls WebSocketStream::WriteFrames() with the appropriate arguments
162 ChannelState WriteFrames() WARN_UNUSED_RESULT; 162 ChannelState WriteFrames() WARN_UNUSED_RESULT;
163 163
164 // Callback from WebSocketStream::WriteFrames. Sends pending data or adjusts 164 // Callback from WebSocketStream::WriteFrames. Sends pending data or adjusts
165 // the send quota of the renderer channel as appropriate. |result| is a net 165 // the send quota of the renderer channel as appropriate. |result| is a net
166 // error code, usually OK. If |synchronous| is true, then OnWriteDone() is 166 // error code, usually OK. If |synchronous| is true, then OnWriteDone() is
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // The current state of the channel. Mainly used for sanity checking, but also 286 // The current state of the channel. Mainly used for sanity checking, but also
287 // used to track the close state. 287 // used to track the close state.
288 State state_; 288 State state_;
289 289
290 DISALLOW_COPY_AND_ASSIGN(WebSocketChannel); 290 DISALLOW_COPY_AND_ASSIGN(WebSocketChannel);
291 }; 291 };
292 292
293 } // namespace net 293 } // namespace net
294 294
295 #endif // NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ 295 #endif // NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_
OLDNEW
« no previous file with comments | « net/websockets/websocket_basic_handshake_stream.cc ('k') | net/websockets/websocket_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698