OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/log/capturing_net_log.h" | 5 #include "net/log/test_net_log.h" |
6 | 6 |
7 namespace net { | 7 namespace net { |
8 | 8 |
9 CapturingNetLog::CapturingNetLog() { | 9 TestNetLog::TestNetLog() { |
10 DeprecatedAddObserver(&capturing_net_log_observer_, LOG_ALL_BUT_BYTES); | 10 DeprecatedAddObserver(&capturing_net_log_observer_, LOG_ALL_BUT_BYTES); |
11 } | 11 } |
12 | 12 |
13 CapturingNetLog::~CapturingNetLog() { | 13 TestNetLog::~TestNetLog() { |
14 DeprecatedRemoveObserver(&capturing_net_log_observer_); | 14 DeprecatedRemoveObserver(&capturing_net_log_observer_); |
15 } | 15 } |
16 | 16 |
17 void CapturingNetLog::SetLogLevel(NetLog::LogLevel log_level) { | 17 void TestNetLog::SetLogLevel(NetLog::LogLevel log_level) { |
18 SetObserverLogLevel(&capturing_net_log_observer_, log_level); | 18 SetObserverLogLevel(&capturing_net_log_observer_, log_level); |
19 } | 19 } |
20 | 20 |
21 void CapturingNetLog::GetEntries( | 21 void TestNetLog::GetEntries(TestNetLog::CapturedEntryList* entry_list) const { |
22 CapturingNetLog::CapturedEntryList* entry_list) const { | |
23 capturing_net_log_observer_.GetEntries(entry_list); | 22 capturing_net_log_observer_.GetEntries(entry_list); |
24 } | 23 } |
25 | 24 |
26 void CapturingNetLog::GetEntriesForSource(NetLog::Source source, | 25 void TestNetLog::GetEntriesForSource(NetLog::Source source, |
27 CapturedEntryList* entry_list) const { | 26 CapturedEntryList* entry_list) const { |
28 capturing_net_log_observer_.GetEntriesForSource(source, entry_list); | 27 capturing_net_log_observer_.GetEntriesForSource(source, entry_list); |
29 } | 28 } |
30 | 29 |
31 size_t CapturingNetLog::GetSize() const { | 30 size_t TestNetLog::GetSize() const { |
32 return capturing_net_log_observer_.GetSize(); | 31 return capturing_net_log_observer_.GetSize(); |
33 } | 32 } |
34 | 33 |
35 void CapturingNetLog::Clear() { | 34 void TestNetLog::Clear() { |
36 capturing_net_log_observer_.Clear(); | 35 capturing_net_log_observer_.Clear(); |
37 } | 36 } |
38 | 37 |
39 CapturingBoundNetLog::CapturingBoundNetLog() | 38 BoundTestNetLog::BoundTestNetLog() |
40 : net_log_( | 39 : net_log_( |
41 BoundNetLog::Make(&capturing_net_log_, net::NetLog::SOURCE_NONE)) { | 40 BoundNetLog::Make(&capturing_net_log_, net::NetLog::SOURCE_NONE)) { |
42 } | 41 } |
43 | 42 |
44 CapturingBoundNetLog::~CapturingBoundNetLog() { | 43 BoundTestNetLog::~BoundTestNetLog() { |
45 } | 44 } |
46 | 45 |
47 void CapturingBoundNetLog::GetEntries( | 46 void BoundTestNetLog::GetEntries( |
48 CapturingNetLog::CapturedEntryList* entry_list) const { | 47 TestNetLog::CapturedEntryList* entry_list) const { |
49 capturing_net_log_.GetEntries(entry_list); | 48 capturing_net_log_.GetEntries(entry_list); |
50 } | 49 } |
51 | 50 |
52 void CapturingBoundNetLog::GetEntriesForSource( | 51 void BoundTestNetLog::GetEntriesForSource( |
53 NetLog::Source source, | 52 NetLog::Source source, |
54 CapturingNetLog::CapturedEntryList* entry_list) const { | 53 TestNetLog::CapturedEntryList* entry_list) const { |
55 capturing_net_log_.GetEntriesForSource(source, entry_list); | 54 capturing_net_log_.GetEntriesForSource(source, entry_list); |
56 } | 55 } |
57 | 56 |
58 size_t CapturingBoundNetLog::GetSize() const { | 57 size_t BoundTestNetLog::GetSize() const { |
59 return capturing_net_log_.GetSize(); | 58 return capturing_net_log_.GetSize(); |
60 } | 59 } |
61 | 60 |
62 void CapturingBoundNetLog::Clear() { | 61 void BoundTestNetLog::Clear() { |
63 capturing_net_log_.Clear(); | 62 capturing_net_log_.Clear(); |
64 } | 63 } |
65 | 64 |
66 void CapturingBoundNetLog::SetLogLevel(NetLog::LogLevel log_level) { | 65 void BoundTestNetLog::SetLogLevel(NetLog::LogLevel log_level) { |
67 capturing_net_log_.SetLogLevel(log_level); | 66 capturing_net_log_.SetLogLevel(log_level); |
68 } | 67 } |
69 | 68 |
70 } // namespace net | 69 } // namespace net |
OLD | NEW |