summaryrefslogtreecommitdiffstats
path: root/net/log/test_net_log.cc
blob: d98ffc3a82599a1ad46f6c655277c81298e03cfe (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
69
70
// Copyright (c) 2012 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.

#include "net/log/test_net_log.h"

namespace net {

TestNetLog::TestNetLog() {
  DeprecatedAddObserver(&capturing_net_log_observer_,
                        NetLogCaptureMode::IncludeCookiesAndCredentials());
}

TestNetLog::~TestNetLog() {
  DeprecatedRemoveObserver(&capturing_net_log_observer_);
}

void TestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) {
  SetObserverCaptureMode(&capturing_net_log_observer_, capture_mode);
}

void TestNetLog::GetEntries(TestNetLog::CapturedEntryList* entry_list) const {
  capturing_net_log_observer_.GetEntries(entry_list);
}

void TestNetLog::GetEntriesForSource(NetLog::Source source,
                                     CapturedEntryList* entry_list) const {
  capturing_net_log_observer_.GetEntriesForSource(source, entry_list);
}

size_t TestNetLog::GetSize() const {
  return capturing_net_log_observer_.GetSize();
}

void TestNetLog::Clear() {
  capturing_net_log_observer_.Clear();
}

BoundTestNetLog::BoundTestNetLog()
    : net_log_(
          BoundNetLog::Make(&capturing_net_log_, net::NetLog::SOURCE_NONE)) {
}

BoundTestNetLog::~BoundTestNetLog() {
}

void BoundTestNetLog::GetEntries(
    TestNetLog::CapturedEntryList* entry_list) const {
  capturing_net_log_.GetEntries(entry_list);
}

void BoundTestNetLog::GetEntriesForSource(
    NetLog::Source source,
    TestNetLog::CapturedEntryList* entry_list) const {
  capturing_net_log_.GetEntriesForSource(source, entry_list);
}

size_t BoundTestNetLog::GetSize() const {
  return capturing_net_log_.GetSize();
}

void BoundTestNetLog::Clear() {
  capturing_net_log_.Clear();
}

void BoundTestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) {
  capturing_net_log_.SetCaptureMode(capture_mode);
}

}  // namespace net