| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/base/capturing_net_log.h" | 5 #include "net/base/capturing_net_log.h" |
| 6 | 6 |
| 7 namespace net { | 7 namespace net { |
| 8 | 8 |
| 9 CapturingNetLog::Entry::Entry(EventType type, | 9 CapturingNetLog::Entry::Entry(EventType type, |
| 10 const base::TimeTicks& time, | 10 const base::TimeTicks& time, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 AutoLock lock(lock_); | 31 AutoLock lock(lock_); |
| 32 Entry entry(type, time, source, phase, extra_parameters); | 32 Entry entry(type, time, source, phase, extra_parameters); |
| 33 if (entries_.size() + 1 < max_num_entries_) | 33 if (entries_.size() + 1 < max_num_entries_) |
| 34 entries_.push_back(entry); | 34 entries_.push_back(entry); |
| 35 } | 35 } |
| 36 | 36 |
| 37 uint32 CapturingNetLog::NextID() { | 37 uint32 CapturingNetLog::NextID() { |
| 38 return base::subtle::NoBarrier_AtomicIncrement(&last_id_, 1); | 38 return base::subtle::NoBarrier_AtomicIncrement(&last_id_, 1); |
| 39 } | 39 } |
| 40 | 40 |
| 41 NetLog::LogLevel CapturingNetLog::GetLogLevel() const { |
| 42 return LOG_ALL_BUT_BYTES; |
| 43 } |
| 44 |
| 41 void CapturingNetLog::GetEntries(EntryList* entry_list) const { | 45 void CapturingNetLog::GetEntries(EntryList* entry_list) const { |
| 42 AutoLock lock(lock_); | 46 AutoLock lock(lock_); |
| 43 *entry_list = entries_; | 47 *entry_list = entries_; |
| 44 } | 48 } |
| 45 | 49 |
| 46 void CapturingNetLog::Clear() { | 50 void CapturingNetLog::Clear() { |
| 47 AutoLock lock(lock_); | 51 AutoLock lock(lock_); |
| 48 entries_.clear(); | 52 entries_.clear(); |
| 49 } | 53 } |
| 50 | 54 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 61 void CapturingBoundNetLog::GetEntries( | 65 void CapturingBoundNetLog::GetEntries( |
| 62 CapturingNetLog::EntryList* entry_list) const { | 66 CapturingNetLog::EntryList* entry_list) const { |
| 63 capturing_net_log_->GetEntries(entry_list); | 67 capturing_net_log_->GetEntries(entry_list); |
| 64 } | 68 } |
| 65 | 69 |
| 66 void CapturingBoundNetLog::Clear() { | 70 void CapturingBoundNetLog::Clear() { |
| 67 capturing_net_log_->Clear(); | 71 capturing_net_log_->Clear(); |
| 68 } | 72 } |
| 69 | 73 |
| 70 } // namespace net | 74 } // namespace net |
| OLD | NEW |