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 GetEntries(EntryList* entry_list) const; |
| void Clear(); |
| private: |
| - uint32 next_id_; |
| + // Needs to be "mutable" so can use it in GetEntries(). |
| + mutable Lock lock_; |
| + base::subtle::Atomic32 next_id_; |
|
eroman
2010/11/18 18:04:03
nit: For consistency with ChromeNetLog, you should
mmenke
2010/11/23 16:48:45
ChromeNetLog's is the id of the last event that oc
|
| 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); |
|
eroman
2010/11/18 18:04:03
I didn't think CapturingNetLog was refcounted?
mmenke
2010/11/23 16:48:45
Thanks. Holdover from the first pass.
|
| explicit CapturingBoundNetLog(size_t max_num_entries); |
| @@ -86,9 +91,7 @@ |
| } |
| // Returns the list of all entries in the log. |
|
eroman
2010/11/18 18:04:03
nit: "Returns" --> "Fills" ?
|
| - const CapturingNetLog::EntryList& entries() const { |
| - return capturing_net_log_->entries(); |
| - } |
| + void GetEntries(CapturingNetLog::EntryList* entry_list) const; |
| void Clear(); |