1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_SERVER_WEB_SOCKET_H_
6 #define NET_SERVER_WEB_SOCKET_H_
10 #include "base/basictypes.h"
11 #include "base/strings/string_piece.h"
17 class HttpServerRequestInfo
;
28 static WebSocket
* CreateWebSocket(HttpServer
* server
,
29 HttpConnection
* connection
,
30 const HttpServerRequestInfo
& request
,
33 virtual void Accept(const HttpServerRequestInfo
& request
) = 0;
34 virtual ParseResult
Read(std::string
* message
) = 0;
35 virtual void Send(const std::string
& message
) = 0;
39 WebSocket(HttpServer
* server
, HttpConnection
* connection
);
41 HttpServer
* const server_
;
42 HttpConnection
* const connection_
;
45 DISALLOW_COPY_AND_ASSIGN(WebSocket
);
50 #endif // NET_SERVER_WEB_SOCKET_H_