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

Unified Diff: net/server/http_listen_socket.h

Issue 2870062: DevTools: implement basic handshake for remote debugging. (Closed)
Patch Set: utf16 conversion Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: net/server/http_listen_socket.h
diff --git a/net/server/http_listen_socket.h b/net/server/http_listen_socket.h
index 5517af004c5075863da0cc2f59fcb8a0eedd2fbd..536abb25246bb6a9c89abdb74906573b3b354760 100644
--- a/net/server/http_listen_socket.h
+++ b/net/server/http_listen_socket.h
@@ -16,10 +16,10 @@ class HttpListenSocket : public ListenSocket,
class Delegate {
public:
virtual void OnHttpRequest(HttpListenSocket* socket,
- HttpServerRequestInfo* info) = 0;
+ const HttpServerRequestInfo& info) = 0;
virtual void OnWebSocketRequest(HttpListenSocket* socket,
- HttpServerRequestInfo* info) = 0;
+ const HttpServerRequestInfo& info) = 0;
virtual void OnWebSocketMessage(HttpListenSocket* socket,
const std::string& data) = 0;
@@ -29,16 +29,22 @@ class HttpListenSocket : public ListenSocket,
virtual ~Delegate() {}
};
+ virtual void Accept();
+
static HttpListenSocket* Listen(const std::string& ip,
int port,
HttpListenSocket::Delegate* delegate);
- void AcceptWebSocket(HttpServerRequestInfo* request);
+ void AcceptWebSocket(const HttpServerRequestInfo& request);
void SendOverWebSocket(const std::string& data);
+ void Send200(const std::string& data, const std::string& mime_type);
+ void Send404();
+ void Send500(const std::string& message);
+
+ void Close() { ListenSocket::Close(); }
void Listen() { ListenSocket::Listen(); }
- virtual void Accept();
// ListenSocketDelegate
virtual void DidAccept(ListenSocket* server, ListenSocket* connection);
@@ -53,7 +59,7 @@ class HttpListenSocket : public ListenSocket,
// Expects the raw data to be stored in recv_data_. If parsing is successful,
// will remove the data parsed from recv_data_, leaving only the unused
// recv data.
- HttpServerRequestInfo* ParseHeaders();
+ bool ParseHeaders(HttpServerRequestInfo* info);
HttpListenSocket::Delegate* delegate_;
bool is_web_socket_;

Powered by Google App Engine
This is Rietveld 408576698