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

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

Issue 10386048: Decouple DevTools from socket implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/server/http_connection.h ('k') | net/server/http_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_SERVER_HTTP_SERVER_H_ 5 #ifndef NET_SERVER_HTTP_SERVER_H_
6 #define NET_SERVER_HTTP_SERVER_H_ 6 #define NET_SERVER_HTTP_SERVER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 21 matching lines...) Expand all
32 32
33 virtual void OnWebSocketMessage(int connection_id, 33 virtual void OnWebSocketMessage(int connection_id,
34 const std::string& data) = 0; 34 const std::string& data) = 0;
35 35
36 virtual void OnClose(int connection_id) = 0; 36 virtual void OnClose(int connection_id) = 0;
37 37
38 protected: 38 protected:
39 virtual ~Delegate() {} 39 virtual ~Delegate() {}
40 }; 40 };
41 41
42 HttpServer(const std::string& host, int port, HttpServer::Delegate* del); 42 HttpServer(const StreamListenSocketFactory& socket_factory,
43 HttpServer::Delegate* delegate);
43 44
44 void AcceptWebSocket(int connection_id, 45 void AcceptWebSocket(int connection_id,
45 const HttpServerRequestInfo& request); 46 const HttpServerRequestInfo& request);
46 void SendOverWebSocket(int connection_id, const std::string& data); 47 void SendOverWebSocket(int connection_id, const std::string& data);
47 void Send(int connection_id, const std::string& data); 48 void Send(int connection_id, const std::string& data);
48 void Send(int connection_id, const char* bytes, int len); 49 void Send(int connection_id, const char* bytes, int len);
49 void Send200(int connection_id, 50 void Send200(int connection_id,
50 const std::string& data, 51 const std::string& data,
51 const std::string& mime_type); 52 const std::string& mime_type);
52 void Send404(int connection_id); 53 void Send404(int connection_id);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 IdToConnectionMap id_to_connection_; 85 IdToConnectionMap id_to_connection_;
85 typedef std::map<StreamListenSocket*, HttpConnection*> SocketToConnectionMap; 86 typedef std::map<StreamListenSocket*, HttpConnection*> SocketToConnectionMap;
86 SocketToConnectionMap socket_to_connection_; 87 SocketToConnectionMap socket_to_connection_;
87 88
88 DISALLOW_COPY_AND_ASSIGN(HttpServer); 89 DISALLOW_COPY_AND_ASSIGN(HttpServer);
89 }; 90 };
90 91
91 } // namespace net 92 } // namespace net
92 93
93 #endif // NET_SERVER_HTTP_SERVER_H_ 94 #endif // NET_SERVER_HTTP_SERVER_H_
OLDNEW
« no previous file with comments | « net/server/http_connection.h ('k') | net/server/http_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698