| Index: net/base/capturing_net_log.cc
|
| ===================================================================
|
| --- net/base/capturing_net_log.cc (revision 137673)
|
| +++ net/base/capturing_net_log.cc (working copy)
|
| @@ -5,19 +5,19 @@
|
| #include "net/base/capturing_net_log.h"
|
|
|
| #include "base/logging.h"
|
| +#include "base/values.h"
|
|
|
| namespace net {
|
|
|
| -CapturingNetLog::Entry::Entry(EventType type,
|
| - const base::TimeTicks& time,
|
| - Source source,
|
| - EventPhase phase,
|
| - EventParameters* extra_parameters)
|
| - : type(type), time(time), source(source), phase(phase),
|
| - extra_parameters(extra_parameters) {
|
| +CapturingNetLog::CapturedEntry::CapturedEntry(
|
| + EventType type,
|
| + const base::TimeTicks& time,
|
| + Source source,
|
| + EventPhase phase)
|
| + : type(type), time(time), source(source), phase(phase) {
|
| }
|
|
|
| -CapturingNetLog::Entry::~Entry() {}
|
| +CapturingNetLog::CapturedEntry::~CapturedEntry() {}
|
|
|
| CapturingNetLog::CapturingNetLog(size_t max_num_entries)
|
| : last_id_(0),
|
| @@ -27,14 +27,14 @@
|
|
|
| CapturingNetLog::~CapturingNetLog() {}
|
|
|
| -void CapturingNetLog::GetEntries(EntryList* entry_list) const {
|
| +void CapturingNetLog::GetEntries(CapturedEntryList* entry_list) const {
|
| base::AutoLock lock(lock_);
|
| - *entry_list = entries_;
|
| + *entry_list = captured_entries_;
|
| }
|
|
|
| void CapturingNetLog::Clear() {
|
| base::AutoLock lock(lock_);
|
| - entries_.clear();
|
| + captured_entries_.clear();
|
| }
|
|
|
| void CapturingNetLog::SetLogLevel(NetLog::LogLevel log_level) {
|
| @@ -42,16 +42,16 @@
|
| log_level_ = log_level;
|
| }
|
|
|
| -void CapturingNetLog::AddEntry(
|
| - EventType type,
|
| - const Source& source,
|
| - EventPhase phase,
|
| - const scoped_refptr<EventParameters>& extra_parameters) {
|
| - DCHECK(source.is_valid());
|
| +void CapturingNetLog::OnAddEntry(const net::NetLog::Entry& entry) {
|
| + DCHECK(entry.source().is_valid());
|
| base::AutoLock lock(lock_);
|
| - Entry entry(type, base::TimeTicks::Now(), source, phase, extra_parameters);
|
| - if (entries_.size() + 1 < max_num_entries_)
|
| - entries_.push_back(entry);
|
| + if (captured_entries_.size() >= max_num_entries_)
|
| + return;
|
| + captured_entries_.push_back(
|
| + CapturedEntry(entry.type(),
|
| + base::TimeTicks::Now(),
|
| + entry.source(),
|
| + entry.phase()));
|
| }
|
|
|
| uint32 CapturingNetLog::NextID() {
|
| @@ -88,7 +88,7 @@
|
| CapturingBoundNetLog::~CapturingBoundNetLog() {}
|
|
|
| void CapturingBoundNetLog::GetEntries(
|
| - CapturingNetLog::EntryList* entry_list) const {
|
| + CapturingNetLog::CapturedEntryList* entry_list) const {
|
| capturing_net_log_.GetEntries(entry_list);
|
| }
|
|
|
|
|