summaryrefslogtreecommitdiffstats
path: root/net/base/capturing_net_log.h
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 05:22:13 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 05:22:13 +0000
commitfba65f7b1dbb530401030f9aac9886a0e75fe4c2 (patch)
tree2c292ca19939fe79e646d5f2b579186acc51d6b9 /net/base/capturing_net_log.h
parent4fd13395a6cfaecb0463563b4deaa1e7b8eff87c (diff)
downloadchromium_src-fba65f7b1dbb530401030f9aac9886a0e75fe4c2.zip
chromium_src-fba65f7b1dbb530401030f9aac9886a0e75fe4c2.tar.gz
chromium_src-fba65f7b1dbb530401030f9aac9886a0e75fe4c2.tar.bz2
Add a source id to global NetLog entries, which makes them
easier to sort in about:net-internals, making the world a happier, fuzzier place. Also slightly simplifies the functions to add NetLog entries, and makes it impossible to create a BoundNetLog with both an invalid source and a non-NULL NetLog. BUG=116597 Review URL: https://chromiumcodereview.appspot.com/9585026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/capturing_net_log.h')
-rw-r--r--net/base/capturing_net_log.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/net/base/capturing_net_log.h b/net/base/capturing_net_log.h
index 97b141c..2482d04 100644
--- a/net/base/capturing_net_log.h
+++ b/net/base/capturing_net_log.h
@@ -12,7 +12,6 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "base/time.h"
#include "net/base/net_export.h"
@@ -57,11 +56,11 @@ class NET_EXPORT CapturingNetLog : public NetLog {
void SetLogLevel(NetLog::LogLevel log_level);
// NetLog implementation:
- virtual void AddEntry(EventType type,
- const base::TimeTicks& time,
- const Source& source,
- EventPhase phase,
- EventParameters* extra_parameters) OVERRIDE;
+ virtual void AddEntry(
+ EventType type,
+ const Source& source,
+ EventPhase phase,
+ const scoped_refptr<EventParameters>& extra_parameters) OVERRIDE;
virtual uint32 NextID() OVERRIDE;
virtual LogLevel GetLogLevel() const OVERRIDE;
virtual void AddThreadSafeObserver(ThreadSafeObserver* observer,
@@ -92,16 +91,12 @@ class NET_EXPORT CapturingNetLog : public NetLog {
// bound() method.
class NET_EXPORT_PRIVATE CapturingBoundNetLog {
public:
- CapturingBoundNetLog(const NetLog::Source& source, CapturingNetLog* net_log);
-
explicit CapturingBoundNetLog(size_t max_num_entries);
~CapturingBoundNetLog();
// The returned BoundNetLog is only valid while |this| is alive.
- BoundNetLog bound() const {
- return BoundNetLog(source_, capturing_net_log_.get());
- }
+ BoundNetLog bound() const { return net_log_; }
// Fills |entry_list| with all entries in the log.
void GetEntries(CapturingNetLog::EntryList* entry_list) const;
@@ -112,8 +107,8 @@ class NET_EXPORT_PRIVATE CapturingBoundNetLog {
void SetLogLevel(NetLog::LogLevel log_level);
private:
- NetLog::Source source_;
- scoped_ptr<CapturingNetLog> capturing_net_log_;
+ CapturingNetLog capturing_net_log_;
+ const BoundNetLog net_log_;
DISALLOW_COPY_AND_ASSIGN(CapturingBoundNetLog);
};