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

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: Update 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
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 // Note that the constructed HttpServer instance does not take ownership of
43 // the provided socket factory. The factory instance is only used here for
44 // construction which means that it does not need to live longer that the
45 // constructor duration.
pfeldman 2012/05/14 11:12:00 Passing a server socket instance here would be sel
Philippe 2012/05/14 12:36:52 Indeed. The initial motivation (still valid in my
46 HttpServer(HttpServer::Delegate* delegate,
47 StreamListenSocketFactory* socket_factory);
43 48
44 void AcceptWebSocket(int connection_id, 49 void AcceptWebSocket(int connection_id,
45 const HttpServerRequestInfo& request); 50 const HttpServerRequestInfo& request);
46 void SendOverWebSocket(int connection_id, const std::string& data); 51 void SendOverWebSocket(int connection_id, const std::string& data);
47 void Send(int connection_id, const std::string& data); 52 void Send(int connection_id, const std::string& data);
48 void Send(int connection_id, const char* bytes, int len); 53 void Send(int connection_id, const char* bytes, int len);
49 void Send200(int connection_id, 54 void Send200(int connection_id,
50 const std::string& data, 55 const std::string& data,
51 const std::string& mime_type); 56 const std::string& mime_type);
52 void Send404(int connection_id); 57 void Send404(int connection_id);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 IdToConnectionMap id_to_connection_; 89 IdToConnectionMap id_to_connection_;
85 typedef std::map<StreamListenSocket*, HttpConnection*> SocketToConnectionMap; 90 typedef std::map<StreamListenSocket*, HttpConnection*> SocketToConnectionMap;
86 SocketToConnectionMap socket_to_connection_; 91 SocketToConnectionMap socket_to_connection_;
87 92
88 DISALLOW_COPY_AND_ASSIGN(HttpServer); 93 DISALLOW_COPY_AND_ASSIGN(HttpServer);
89 }; 94 };
90 95
91 } // namespace net 96 } // namespace net
92 97
93 #endif // NET_SERVER_HTTP_SERVER_H_ 98 #endif // NET_SERVER_HTTP_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698