| 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/test_net_log.h" | 5 #include "net/log/test_net_log.h" |
| 6 | 6 |
| 7 namespace net { | 7 namespace net { |
| 8 | 8 |
| 9 TestNetLog::TestNetLog() { | 9 TestNetLog::TestNetLog() { |
| 10 DeprecatedAddObserver(&capturing_net_log_observer_, | 10 DeprecatedAddObserver(&capturing_net_log_observer_, |
| 11 NetLogCaptureMode::IncludeCookiesAndCredentials()); | 11 NetLogCaptureMode::IncludeCookiesAndCredentials()); |
| 12 } | 12 } |
| 13 | 13 |
| 14 TestNetLog::~TestNetLog() { | 14 TestNetLog::~TestNetLog() { |
| 15 DeprecatedRemoveObserver(&capturing_net_log_observer_); | 15 DeprecatedRemoveObserver(&capturing_net_log_observer_); |
| 16 } | 16 } |
| 17 | 17 |
| 18 void TestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) { | 18 void TestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) { |
| 19 SetObserverCaptureMode(&capturing_net_log_observer_, capture_mode); | 19 SetObserverCaptureMode(&capturing_net_log_observer_, capture_mode); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void TestNetLog::GetEntries(TestNetLog::CapturedEntryList* entry_list) const { | 22 void TestNetLog::GetEntries(CapturedNetLogEntry::List* entry_list) const { |
| 23 capturing_net_log_observer_.GetEntries(entry_list); | 23 capturing_net_log_observer_.GetEntries(entry_list); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void TestNetLog::GetEntriesForSource(NetLog::Source source, | 26 void TestNetLog::GetEntriesForSource( |
| 27 CapturedEntryList* entry_list) const { | 27 NetLog::Source source, |
| 28 CapturedNetLogEntry::List* entry_list) const { |
| 28 capturing_net_log_observer_.GetEntriesForSource(source, entry_list); | 29 capturing_net_log_observer_.GetEntriesForSource(source, entry_list); |
| 29 } | 30 } |
| 30 | 31 |
| 31 size_t TestNetLog::GetSize() const { | 32 size_t TestNetLog::GetSize() const { |
| 32 return capturing_net_log_observer_.GetSize(); | 33 return capturing_net_log_observer_.GetSize(); |
| 33 } | 34 } |
| 34 | 35 |
| 35 void TestNetLog::Clear() { | 36 void TestNetLog::Clear() { |
| 36 capturing_net_log_observer_.Clear(); | 37 capturing_net_log_observer_.Clear(); |
| 37 } | 38 } |
| 38 | 39 |
| 39 BoundTestNetLog::BoundTestNetLog() | 40 BoundTestNetLog::BoundTestNetLog() |
| 40 : net_log_(BoundNetLog::Make(&capturing_net_log_, NetLog::SOURCE_NONE)) { | 41 : net_log_(BoundNetLog::Make(&capturing_net_log_, NetLog::SOURCE_NONE)) { |
| 41 } | 42 } |
| 42 | 43 |
| 43 BoundTestNetLog::~BoundTestNetLog() { | 44 BoundTestNetLog::~BoundTestNetLog() { |
| 44 } | 45 } |
| 45 | 46 |
| 46 void BoundTestNetLog::GetEntries( | 47 void BoundTestNetLog::GetEntries(CapturedNetLogEntry::List* entry_list) const { |
| 47 TestNetLog::CapturedEntryList* entry_list) const { | |
| 48 capturing_net_log_.GetEntries(entry_list); | 48 capturing_net_log_.GetEntries(entry_list); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void BoundTestNetLog::GetEntriesForSource( | 51 void BoundTestNetLog::GetEntriesForSource( |
| 52 NetLog::Source source, | 52 NetLog::Source source, |
| 53 TestNetLog::CapturedEntryList* entry_list) const { | 53 CapturedNetLogEntry::List* entry_list) const { |
| 54 capturing_net_log_.GetEntriesForSource(source, entry_list); | 54 capturing_net_log_.GetEntriesForSource(source, entry_list); |
| 55 } | 55 } |
| 56 | 56 |
| 57 size_t BoundTestNetLog::GetSize() const { | 57 size_t BoundTestNetLog::GetSize() const { |
| 58 return capturing_net_log_.GetSize(); | 58 return capturing_net_log_.GetSize(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void BoundTestNetLog::Clear() { | 61 void BoundTestNetLog::Clear() { |
| 62 capturing_net_log_.Clear(); | 62 capturing_net_log_.Clear(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void BoundTestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) { | 65 void BoundTestNetLog::SetCaptureMode(NetLogCaptureMode capture_mode) { |
| 66 capturing_net_log_.SetCaptureMode(capture_mode); | 66 capturing_net_log_.SetCaptureMode(capture_mode); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace net | 69 } // namespace net |
| OLD | NEW |