| 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 #ifndef CHROME_BROWSER_NET_CHROME_NET_LOG_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_NET_LOG_H_ |
| 6 #define CHROME_BROWSER_NET_CHROME_NET_LOG_H_ | 6 #define CHROME_BROWSER_NET_CHROME_NET_LOG_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
| 10 | 10 |
| 11 class LoadTimingObserver; |
| 11 class PassiveLogCollector; | 12 class PassiveLogCollector; |
| 12 | 13 |
| 13 // ChromeNetLog is an implementation of NetLog that dispatches network log | 14 // ChromeNetLog is an implementation of NetLog that dispatches network log |
| 14 // messages to a list of observers. | 15 // messages to a list of observers. |
| 15 // | 16 // |
| 16 // By default, ChromeNetLog will attach the observer PassiveLogCollector which | 17 // By default, ChromeNetLog will attach the observer PassiveLogCollector which |
| 17 // will keep track of recent request information (which used when displaying | 18 // will keep track of recent request information (which used when displaying |
| 18 // the about:net-internals page). | 19 // the about:net-internals page). |
| 19 // | 20 // |
| 20 // TODO(eroman): Move this default observer out of ChromeNetLog. | 21 // TODO(eroman): Move this default observer out of ChromeNetLog. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 virtual uint32 NextID(); | 45 virtual uint32 NextID(); |
| 45 virtual bool HasListener() const; | 46 virtual bool HasListener() const; |
| 46 | 47 |
| 47 void AddObserver(Observer* observer); | 48 void AddObserver(Observer* observer); |
| 48 void RemoveObserver(Observer* observer); | 49 void RemoveObserver(Observer* observer); |
| 49 | 50 |
| 50 PassiveLogCollector* passive_collector() { | 51 PassiveLogCollector* passive_collector() { |
| 51 return passive_collector_.get(); | 52 return passive_collector_.get(); |
| 52 } | 53 } |
| 53 | 54 |
| 55 LoadTimingObserver* load_timing_observer() { |
| 56 return load_timing_observer_.get(); |
| 57 } |
| 58 |
| 54 private: | 59 private: |
| 55 uint32 next_id_; | 60 uint32 next_id_; |
| 56 scoped_ptr<PassiveLogCollector> passive_collector_; | 61 scoped_ptr<PassiveLogCollector> passive_collector_; |
| 62 scoped_ptr<LoadTimingObserver> load_timing_observer_; |
| 57 ObserverList<Observer, true> observers_; | 63 ObserverList<Observer, true> observers_; |
| 58 | 64 |
| 59 DISALLOW_COPY_AND_ASSIGN(ChromeNetLog); | 65 DISALLOW_COPY_AND_ASSIGN(ChromeNetLog); |
| 60 }; | 66 }; |
| 61 | 67 |
| 62 #endif // CHROME_BROWSER_NET_CHROME_NET_LOG_H_ | 68 #endif // CHROME_BROWSER_NET_CHROME_NET_LOG_H_ |
| OLD | NEW |