Dismiss autofill popup on screen orientation change.
[chromium-blink-merge.git] / net / server / http_connection.h
blobb0e37663d4f61b696ced07c31d9b9cfdfb11b6f2
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.
5 #ifndef NET_SERVER_HTTP_CONNECTION_H_
6 #define NET_SERVER_HTTP_CONNECTION_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "net/http/http_status_code.h"
15 namespace net {
17 class HttpServer;
18 class HttpServerResponseInfo;
19 class StreamListenSocket;
20 class WebSocket;
22 class HttpConnection {
23 public:
24 ~HttpConnection();
26 void Send(const std::string& data);
27 void Send(const char* bytes, int len);
28 void Send(const HttpServerResponseInfo& response);
30 void Shift(int num_bytes);
32 const std::string& recv_data() const { return recv_data_; }
33 int id() const { return id_; }
35 private:
36 friend class HttpServer;
37 static int last_id_;
39 HttpConnection(HttpServer* server, StreamListenSocket* sock);
41 void DetachSocket();
43 HttpServer* server_;
44 scoped_refptr<StreamListenSocket> socket_;
45 scoped_ptr<WebSocket> web_socket_;
46 std::string recv_data_;
47 int id_;
48 DISALLOW_COPY_AND_ASSIGN(HttpConnection);
51 } // namespace net
53 #endif // NET_SERVER_HTTP_CONNECTION_H_