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 #include "net/log/test_net_log.h"
9 TestNetLog::TestNetLog() {
10 DeprecatedAddObserver(&capturing_net_log_observer_
,
11 NetLogCaptureMode::IncludeCookiesAndCredentials());
14 TestNetLog::~TestNetLog() {
15 DeprecatedRemoveObserver(&capturing_net_log_observer_
);
18 void TestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode
) {
19 SetObserverCaptureMode(&capturing_net_log_observer_
, capture_mode
);
22 void TestNetLog::GetEntries(TestNetLog::CapturedEntryList
* entry_list
) const {
23 capturing_net_log_observer_
.GetEntries(entry_list
);
26 void TestNetLog::GetEntriesForSource(NetLog::Source source
,
27 CapturedEntryList
* entry_list
) const {
28 capturing_net_log_observer_
.GetEntriesForSource(source
, entry_list
);
31 size_t TestNetLog::GetSize() const {
32 return capturing_net_log_observer_
.GetSize();
35 void TestNetLog::Clear() {
36 capturing_net_log_observer_
.Clear();
39 BoundTestNetLog::BoundTestNetLog()
41 BoundNetLog::Make(&capturing_net_log_
, net::NetLog::SOURCE_NONE
)) {
44 BoundTestNetLog::~BoundTestNetLog() {
47 void BoundTestNetLog::GetEntries(
48 TestNetLog::CapturedEntryList
* entry_list
) const {
49 capturing_net_log_
.GetEntries(entry_list
);
52 void BoundTestNetLog::GetEntriesForSource(
53 NetLog::Source source
,
54 TestNetLog::CapturedEntryList
* entry_list
) const {
55 capturing_net_log_
.GetEntriesForSource(source
, entry_list
);
58 size_t BoundTestNetLog::GetSize() const {
59 return capturing_net_log_
.GetSize();
62 void BoundTestNetLog::Clear() {
63 capturing_net_log_
.Clear();
66 void BoundTestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode
) {
67 capturing_net_log_
.SetCaptureMode(capture_mode
);