OLD | NEW |
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 <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 const WebSocketStreamCreator& creator); | 197 const WebSocketStreamCreator& creator); |
198 | 198 |
199 // Success callback from WebSocketStream::CreateAndConnectStream(). Reports | 199 // Success callback from WebSocketStream::CreateAndConnectStream(). Reports |
200 // success to the event interface. May delete |this|. | 200 // success to the event interface. May delete |this|. |
201 void OnConnectSuccess(scoped_ptr<WebSocketStream> stream); | 201 void OnConnectSuccess(scoped_ptr<WebSocketStream> stream); |
202 | 202 |
203 // Failure callback from WebSocketStream::CreateAndConnectStream(). Reports | 203 // Failure callback from WebSocketStream::CreateAndConnectStream(). Reports |
204 // failure to the event interface. May delete |this|. | 204 // failure to the event interface. May delete |this|. |
205 void OnConnectFailure(const std::string& message); | 205 void OnConnectFailure(const std::string& message); |
206 | 206 |
| 207 // SSL certificate error callback from |
| 208 // WebSocketStream::CreateAndConnectStream(). Forwards the request to the |
| 209 // event interface. |
| 210 void OnSSLCertificateError( |
| 211 scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks> |
| 212 ssl_error_callbacks, |
| 213 const SSLInfo& ssl_info, |
| 214 bool fatal); |
| 215 |
207 // Posts a task that sends pending notifications relating WebSocket Opening | 216 // Posts a task that sends pending notifications relating WebSocket Opening |
208 // Handshake to the renderer. | 217 // Handshake to the renderer. |
209 void ScheduleOpeningHandshakeNotification(); | 218 void ScheduleOpeningHandshakeNotification(); |
210 | 219 |
211 // Sets |state_| to |new_state| and updates UMA if necessary. | 220 // Sets |state_| to |new_state| and updates UMA if necessary. |
212 void SetState(State new_state); | 221 void SetState(State new_state); |
213 | 222 |
214 // Returns true if state_ is SEND_CLOSED, CLOSE_WAIT or CLOSED. | 223 // Returns true if state_ is SEND_CLOSED, CLOSE_WAIT or CLOSED. |
215 bool InClosingState() const; | 224 bool InClosingState() const; |
216 | 225 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // For UMA. The time when OnConnectSuccess() method was called and |stream_| | 407 // For UMA. The time when OnConnectSuccess() method was called and |stream_| |
399 // was set. | 408 // was set. |
400 base::TimeTicks established_on_; | 409 base::TimeTicks established_on_; |
401 | 410 |
402 DISALLOW_COPY_AND_ASSIGN(WebSocketChannel); | 411 DISALLOW_COPY_AND_ASSIGN(WebSocketChannel); |
403 }; | 412 }; |
404 | 413 |
405 } // namespace net | 414 } // namespace net |
406 | 415 |
407 #endif // NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ | 416 #endif // NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_ |
OLD | NEW |