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/base/capturing_net_log.h"
9 CapturingNetLog::CapturingNetLog() {
10 AddThreadSafeObserver(&capturing_net_log_observer_
, LOG_ALL_BUT_BYTES
);
13 CapturingNetLog::~CapturingNetLog() {
14 RemoveThreadSafeObserver(&capturing_net_log_observer_
);
17 void CapturingNetLog::SetLogLevel(NetLog::LogLevel log_level
) {
18 SetObserverLogLevel(&capturing_net_log_observer_
, log_level
);
21 void CapturingNetLog::GetEntries(
22 CapturingNetLog::CapturedEntryList
* entry_list
) const {
23 capturing_net_log_observer_
.GetEntries(entry_list
);
26 void CapturingNetLog::GetEntriesForSource(
27 NetLog::Source source
,
28 CapturedEntryList
* entry_list
) const {
29 capturing_net_log_observer_
.GetEntriesForSource(source
, entry_list
);
32 size_t CapturingNetLog::GetSize() const {
33 return capturing_net_log_observer_
.GetSize();
36 void CapturingNetLog::Clear() {
37 capturing_net_log_observer_
.Clear();
40 CapturingBoundNetLog::CapturingBoundNetLog()
41 : net_log_(BoundNetLog::Make(&capturing_net_log_
,
42 net::NetLog::SOURCE_NONE
)) {
45 CapturingBoundNetLog::~CapturingBoundNetLog() {}
47 void CapturingBoundNetLog::GetEntries(
48 CapturingNetLog::CapturedEntryList
* entry_list
) const {
49 capturing_net_log_
.GetEntries(entry_list
);
52 void CapturingBoundNetLog::GetEntriesForSource(
53 NetLog::Source source
,
54 CapturingNetLog::CapturedEntryList
* entry_list
) const {
55 capturing_net_log_
.GetEntriesForSource(source
, entry_list
);
58 size_t CapturingBoundNetLog::GetSize() const {
59 return capturing_net_log_
.GetSize();
62 void CapturingBoundNetLog::Clear() {
63 capturing_net_log_
.Clear();
66 void CapturingBoundNetLog::SetLogLevel(NetLog::LogLevel log_level
) {
67 capturing_net_log_
.SetLogLevel(log_level
);