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

Side by Side Diff: net/server/web_socket.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/server/http_server_unittest.cc ('k') | net/server/web_socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef NET_SERVER_WEB_SOCKET_H_
6 #define NET_SERVER_WEB_SOCKET_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/strings/string_piece.h"
12
13 namespace net {
14
15 class HttpConnection;
16 class HttpServer;
17 class HttpServerRequestInfo;
18
19 class WebSocket {
20 public:
21 enum ParseResult {
22 FRAME_OK,
23 FRAME_INCOMPLETE,
24 FRAME_CLOSE,
25 FRAME_ERROR
26 };
27
28 static WebSocket* CreateWebSocket(HttpServer* server,
29 HttpConnection* connection,
30 const HttpServerRequestInfo& request,
31 size_t* pos);
32
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;
36 virtual ~WebSocket();
37
38 protected:
39 WebSocket(HttpServer* server, HttpConnection* connection);
40
41 HttpServer* const server_;
42 HttpConnection* const connection_;
43
44 private:
45 DISALLOW_COPY_AND_ASSIGN(WebSocket);
46 };
47
48 } // namespace net
49
50 #endif // NET_SERVER_WEB_SOCKET_H_
OLDNEW
« no previous file with comments | « net/server/http_server_unittest.cc ('k') | net/server/web_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698