http_session.h revision 3345a6884c488ff3a535c2c9acdd33d74b37e311
1// Copyright (c) 2010 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.
4
5#ifndef NET_BASE_TOOLS_HTTP_SESSION_H_
6#define NET_BASE_TOOLS_HTTP_SESSION_H_
7#pragma once
8
9#include "base/basictypes.h"
10#include "net/http/http_request_info.h"
11#include "net/tools/fetch/http_listen_socket.h"
12
13// An HttpSession encapsulates a server-side HTTP listen socket.
14class HttpSession : HttpListenSocket::Delegate {
15 public:
16  HttpSession(const std::string& ip, int port);
17  virtual ~HttpSession();
18
19  virtual void OnRequest(HttpListenSocket* connection,
20                         HttpServerRequestInfo* info);
21
22 private:
23  scoped_refptr<HttpListenSocket> socket_;
24  DISALLOW_COPY_AND_ASSIGN(HttpSession);
25};
26
27#endif // NET_BASE_TOOLS_HTTP_SESSION_H_
28
29