Chromium Code Reviews| Index: net/base/capturing_net_log.h |
| =================================================================== |
| --- net/base/capturing_net_log.h (revision 65207) |
| +++ net/base/capturing_net_log.h (working copy) |
| @@ -8,7 +8,9 @@ |
| #include <vector> |
| +#include "base/atomicops.h" |
| #include "base/basictypes.h" |
| +#include "base/lock.h" |
| #include "base/ref_counted.h" |
| #include "base/scoped_ptr.h" |
| #include "base/time.h" |
| @@ -55,12 +57,14 @@ |
| virtual LogLevel GetLogLevel() const { return LOG_ALL_BUT_BYTES; } |
| // Returns the list of all entries in the log. |
| - const EntryList& entries() const { return entries_; } |
| + void get_entries(EntryList* entry_list) const; |
|
eroman
2010/11/16 17:51:14
nit: GetEntries
|
| void Clear(); |
| private: |
| - uint32 next_id_; |
| + // Needs to be "mutable" so can use it in get_entries(). |
| + mutable Lock lock_; |
| + base::subtle::Atomic32 next_id_; |
| size_t max_num_entries_; |
| EntryList entries_; |
| @@ -74,7 +78,8 @@ |
| // bound() method. |
| class CapturingBoundNetLog { |
| public: |
| - CapturingBoundNetLog(const NetLog::Source& source, CapturingNetLog* net_log); |
| + CapturingBoundNetLog(const NetLog::Source& source, |
| + scoped_refptr<CapturingNetLog>& net_log); |
| explicit CapturingBoundNetLog(size_t max_num_entries); |
| @@ -86,9 +91,7 @@ |
| } |
| // Returns the list of all entries in the log. |
| - const CapturingNetLog::EntryList& entries() const { |
| - return capturing_net_log_->entries(); |
| - } |
| + void get_entries(CapturingNetLog::EntryList* entry_list) const; |
|
eroman
2010/11/16 17:51:14
GetEntries
|
| void Clear(); |