Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: chrome/browser/net/chrome_net_log.h

Issue 848006: Generalize the net module's LoadLog facility from a passive container, to an event stream (NetLog). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Split up RequestTracker into ConnectJobTracker+RequestTracker+RequestTrackerBase, address comments Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/chrome_net_log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_NET_CHROME_NET_LOG_H_
6 #define CHROME_BROWSER_NET_CHROME_NET_LOG_H_
7
8 #include "base/observer_list.h"
9 #include "net/base/net_log.h"
10
11 class PassiveLogCollector;
12
13 // ChromeNetLog is an implementation of NetLog that dispatches network log
14 // messages to a list of observers.
15 //
16 // By default, ChromeNetLog will attach the observer PassiveLogCollector which
17 // will keep track of recent request information (which used when displaying
18 // the about:net-internals page).
19 //
20 // TODO(eroman): Move this default observer out of ChromeNetLog.
21 //
22 class ChromeNetLog : public net::NetLog {
23 public:
24 // Interface for observing the events logged by the network stack.
25 class Observer {
26 public:
27 virtual ~Observer() {}
28 virtual void OnAddEntry(const Entry& entry) = 0;
29 };
30
31 ChromeNetLog();
32 ~ChromeNetLog();
33
34 // NetLog implementation:
35 virtual void AddEntry(const Entry& entry);
36 virtual int NextID();
37 virtual bool HasListener() const;
38
39 void AddObserver(Observer* observer);
40 void RemoveObserver(Observer* observer);
41
42 PassiveLogCollector* passive_collector() {
43 return passive_collector_.get();
44 }
45
46 private:
47 int next_id_;
48 scoped_ptr<PassiveLogCollector> passive_collector_;
49 ObserverList<Observer, true> observers_;
50
51 DISALLOW_COPY_AND_ASSIGN(ChromeNetLog);
52 };
53
54 #endif // CHROME_BROWSER_NET_CHROME_NET_LOG_H_
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/chrome_net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698