diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 21:07:33 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 21:07:33 +0000 |
commit | 095c7cfacf4a59d5241a17207d7a8a8096469334 (patch) | |
tree | 7eb71d968ae4dc9705ba5e9c5ad1b1727f34b2fc /chrome/browser/net/chrome_net_log.h | |
parent | 701142a4edf3872fc9b433b68bdaf2c0a3c22db8 (diff) | |
download | chromium_src-095c7cfacf4a59d5241a17207d7a8a8096469334.zip chromium_src-095c7cfacf4a59d5241a17207d7a8a8096469334.tar.gz chromium_src-095c7cfacf4a59d5241a17207d7a8a8096469334.tar.bz2 |
Fix a regression whereby full-granularity network events were being captured by PassiveLogCollector.
BUG=53883
TEST=Load a webpage. Now open about:net-internals and verify that the log for that URL does NOT contain the HTTP request/response headers.
Review URL: http://codereview.chromium.org/3274016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_net_log.h')
-rw-r--r-- | chrome/browser/net/chrome_net_log.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/chrome/browser/net/chrome_net_log.h b/chrome/browser/net/chrome_net_log.h index bee4c62..24183bf 100644 --- a/chrome/browser/net/chrome_net_log.h +++ b/chrome/browser/net/chrome_net_log.h @@ -28,12 +28,26 @@ class ChromeNetLog : public net::NetLog { // Interface for observing the events logged by the network stack. class Observer { public: + // Constructs an observer that wants to see network events, with + // the specified minimum event granularity. + // + // Typical observers should specify LOG_BASIC. + // + // Observers that need to see the full granularity of events can + // specify LOG_ALL. However doing so will have performance consequences, + // and may cause PassiveLogCollector to use more memory than anticiapted. + explicit Observer(LogLevel log_level); + virtual ~Observer() {} virtual void OnAddEntry(EventType type, const base::TimeTicks& time, const Source& source, EventPhase phase, EventParameters* params) = 0; + LogLevel log_level() const { return log_level_; } + private: + LogLevel log_level_; + DISALLOW_COPY_AND_ASSIGN(Observer); }; ChromeNetLog(); @@ -46,7 +60,7 @@ class ChromeNetLog : public net::NetLog { EventPhase phase, EventParameters* params); virtual uint32 NextID(); - virtual bool HasListener() const; + virtual LogLevel GetLogLevel() const; void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -64,7 +78,10 @@ class ChromeNetLog : public net::NetLog { scoped_ptr<PassiveLogCollector> passive_collector_; scoped_ptr<LoadTimingObserver> load_timing_observer_; scoped_ptr<NetLogLogger> net_log_logger_; - ObserverList<Observer, true> observers_; + + // Note that this needs to be "mutable" so we can iterate over the observer + // list in GetLogLevel(). + mutable ObserverList<Observer, true> observers_; DISALLOW_COPY_AND_ASSIGN(ChromeNetLog); }; |