Home | History | Annotate | Download | only in websockets

Lines Matching full:websocket

8 #include "net/websockets/websocket.h"
20 WebSocket::WebSocket(Request* request, WebSocketDelegate* delegate)
41 WebSocket::~WebSocket() {
47 void WebSocket::Connect() {
67 void WebSocket::Send(const std::string& msg) {
72 // We must not send any data after we start the WebSocket closing handshake.
87 void WebSocket::Close() {
107 // If the WebSocket connection is not yet established, fail the WebSocket
113 NewRunnableMethod(this, &WebSocket::FailConnection));
116 // If the WebSocket closing handshake has not yet been started, start
117 // the WebSocket closing handshake and set the readyState attribute's value
123 NewRunnableMethod(this, &WebSocket::StartClosingHandshake));
130 void WebSocket::DetachDelegate() {
145 void WebSocket::OnConnected(SocketStream* socket_stream,
177 NewRunnableMethod(this, &WebSocket::SendPending));
180 void WebSocket::OnSentData(SocketStream* socket_stream, int amount_sent) {
190 NewRunnableMethod(this, &WebSocket::SendPending));
193 void WebSocket::OnReceivedData(SocketStream* socket_stream,
198 NewRunnableMethod(this, &WebSocket::DoReceivedData));
201 void WebSocket::OnClose(SocketStream* socket_stream) {
203 NewRunnableMethod(this, &WebSocket::DoClose));
206 void WebSocket::OnError(const SocketStream* socket_stream, int error) {
208 FROM_HERE, NewRunnableMethod(this, &WebSocket::DoSocketError, error));
211 void WebSocket::SendPending() {
221 // *The WebSocket closing handshake has started.*
224 // 4.2 3-8-3 If the WebSocket connection is not already closed,
225 // then close the WebSocket connection.
226 // *The WebSocket closing handshake has finished*
230 // WebSocket connection is closed.
232 NewRunnableMethod(this, &WebSocket::DoForceCloseConnection);
250 void WebSocket::DoReceivedData() {
252 scoped_refptr<WebSocket> protect(this);
295 void WebSocket::ProcessFrameData() {
301 scoped_refptr<WebSocket> protect(this);
339 // 1. If the WebSocket closing handshake has not yet started, then
340 // start the WebSocket closing handshake.
345 NewRunnableMethod(this, &WebSocket::StartClosingHandshake));
347 // If the WebSocket closing handshake has been started and
348 // the WebSocket connection is not already closed, then close
349 // the WebSocket connection.
377 // If /error/ is true, then *a WebSocket error has been detected.*
384 void WebSocket::AddToReadBuffer(const char* data, int len) {
397 void WebSocket::SkipReadBuffer(int len) {
422 void WebSocket::StartClosingHandshake() {
423 // 4.2 *start the WebSocket closing handshake*.
425 // 1. If the WebSocket closing handshake has started, then abort these
437 void WebSocket::DoForceCloseConnection() {
438 // 4.2 *start the WebSocket closing handshake*
439 // 6. If the WebSocket connection is not already closed, then close the
440 // WebSocket connection. (If this happens, then the closing handshake
447 void WebSocket::FailConnection() {
450 // *fail the WebSocket connection*.
451 // the user agent must close the WebSocket connection, and may report the
458 void WebSocket::DoClose() {
461 // WebSocket connection is closed while waiting a user-agent-determined
462 // length of time after *The WebSocket closing handshake has started*.
478 void WebSocket::DoSocketError(int error) {