• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 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_HTTP_HTTP_NET_LOG_PARAMS_H_
6 #define NET_HTTP_HTTP_NET_LOG_PARAMS_H_
7 #pragma once
8 
9 #include <string>
10 
11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h"
13 #include "net/base/net_log.h"
14 #include "net/http/http_request_headers.h"
15 
16 class Value;
17 
18 namespace net {
19 
20 class HttpResponseHeaders;
21 
22 class NetLogHttpRequestParameter : public NetLog::EventParameters {
23  public:
24   NetLogHttpRequestParameter(const std::string& line,
25                              const HttpRequestHeaders& headers);
26 
GetHeaders()27   const HttpRequestHeaders& GetHeaders() const {
28     return headers_;
29   }
30 
GetLine()31   const std::string& GetLine() const {
32     return line_;
33   }
34 
35   // NetLog::EventParameters
36   virtual Value* ToValue() const;
37 
38  private:
39   virtual ~NetLogHttpRequestParameter();
40 
41   const std::string line_;
42   HttpRequestHeaders headers_;
43 
44   DISALLOW_COPY_AND_ASSIGN(NetLogHttpRequestParameter);
45 };
46 
47 class NetLogHttpResponseParameter : public NetLog::EventParameters {
48  public:
49   explicit NetLogHttpResponseParameter(
50       const scoped_refptr<HttpResponseHeaders>& headers);
51 
GetHeaders()52   const HttpResponseHeaders& GetHeaders() const {
53     return *headers_;
54   }
55 
56   // NetLog::EventParameters
57   virtual Value* ToValue() const;
58 
59  private:
60   virtual ~NetLogHttpResponseParameter();
61 
62   const scoped_refptr<HttpResponseHeaders> headers_;
63 
64   DISALLOW_COPY_AND_ASSIGN(NetLogHttpResponseParameter);
65 };
66 
67 }  // namespace net
68 
69 #endif  // NET_HTTP_HTTP_NET_LOG_PARAMS_H_
70 
71