summaryrefslogtreecommitdiffstats
path: root/net/http/http_net_log_params.h
blob: 6a0b47b73483d9ebb495ceae2866f72b810a9141 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (c) 2010 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_HTTP_HTTP_NET_LOG_PARAMS_H_
#define NET_HTTP_HTTP_NET_LOG_PARAMS_H_
#pragma once

#include <string>

#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "net/base/net_log.h"
#include "net/http/http_request_headers.h"

class Value;

namespace net {

class HttpResponseHeaders;

class NetLogHttpRequestParameter : public NetLog::EventParameters {
 public:
  NetLogHttpRequestParameter(const std::string& line,
                             const HttpRequestHeaders& headers);

  Value* ToValue() const;

  const HttpRequestHeaders& GetHeaders() const {
    return headers_;
  }

  const std::string& GetLine() const {
    return line_;
  }

 private:
  virtual ~NetLogHttpRequestParameter();

  const std::string line_;
  HttpRequestHeaders headers_;

  DISALLOW_COPY_AND_ASSIGN(NetLogHttpRequestParameter);
};

class NetLogHttpResponseParameter : public NetLog::EventParameters {
 public:
  explicit NetLogHttpResponseParameter(
      const scoped_refptr<HttpResponseHeaders>& headers);

  Value* ToValue() const;

  const HttpResponseHeaders& GetHeaders() const {
    return *headers_;
  }

 private:
  virtual ~NetLogHttpResponseParameter();

  const scoped_refptr<HttpResponseHeaders> headers_;

  DISALLOW_COPY_AND_ASSIGN(NetLogHttpResponseParameter);
};

}  // namespace net

#endif  // NET_HTTP_HTTP_NET_LOG_PARAMS_H_