1 // Copyright (c) 2011 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_
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
17 class HttpServerRequestInfo
;
28 static WebSocket
* CreateWebSocket(HttpConnection
* connection
,
29 const HttpServerRequestInfo
& request
,
32 virtual void Accept(const HttpServerRequestInfo
& request
) = 0;
33 virtual ParseResult
Read(std::string
* message
) = 0;
34 virtual void Send(const std::string
& message
) = 0;
35 virtual ~WebSocket() {}
38 explicit WebSocket(HttpConnection
* connection
);
39 HttpConnection
* connection_
;
42 DISALLOW_COPY_AND_ASSIGN(WebSocket
);
47 #endif // NET_SERVER_WEB_SOCKET_H_