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

Unified Diff: net/server/http_connection.h

Issue 7540023: DevTools: no way to remote debug using ToT build as a client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments addressed. Created 9 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_connection.h
diff --git a/net/server/http_connection.h b/net/server/http_connection.h
new file mode 100644
index 0000000000000000000000000000000000000000..e735c0280cc40439a4b4288318020842883b14f3
--- /dev/null
+++ b/net/server/http_connection.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_SERVER_HTTP_CONNECTION_H_
+#define NET_SERVER_HTTP_CONNECTION_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace net {
+
+class HttpServer;
+class HttpServerRequestInfo;
+class ListenSocket;
+class WebSocket;
+
+class HttpConnection {
+ public:
+ void Send(const std::string& data);
+ void Send(const char* bytes, int len);
+ void Send200(const std::string& data, const std::string& content_type);
+ void Send404();
+ void Send500(const std::string& message);
+
+ void Shift(int num_bytes);
+
+ const std::string& recv_data() const { return recv_data_; }
+ const int id() const { return id_; }
+
+ private:
+ friend class HttpServer;
+ static int lastId_;
eroman 2011/08/02 19:01:33 last_id_
+
+ HttpConnection(HttpServer* server, ListenSocket* sock);
+ ~HttpConnection();
+
+ void DetachSocket();
+
+ HttpServer* server_;
+ scoped_refptr<ListenSocket> socket_;
+ scoped_ptr<WebSocket> web_socket_;
+ std::string recv_data_;
+ int id_;
+ DISALLOW_COPY_AND_ASSIGN(HttpConnection);
+};
+
+} // namespace net
+
+#endif // NET_SERVER_HTTP_CONNECTION_H_
« no previous file with comments | « net/net.gyp ('k') | net/server/http_connection.cc » ('j') | net/server/web_socket.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698