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

Unified Diff: net/tools/gdig/file_net_log.h

Issue 16137008: Refactor net::NetLog to provide implementation of observer pattern, not just the interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_log_unittest.cc ('k') | net/tools/gdig/file_net_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/gdig/file_net_log.h
diff --git a/net/tools/gdig/file_net_log.h b/net/tools/gdig/file_net_log.h
index cb8038062157a7282fda1a4178edc2de49cf2cd6..1ad78f172887f73a71b390ef2468481508c4c599 100644
--- a/net/tools/gdig/file_net_log.h
+++ b/net/tools/gdig/file_net_log.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/atomic_sequence_num.h"
#include "base/basictypes.h"
#include "base/synchronization/lock.h"
#include "base/time.h"
@@ -15,27 +14,18 @@
namespace net {
-// FileNetLog is a simple implementation of NetLog that prints out all
-// the events received into the stream passed to the constructor.
-class FileNetLog : public NetLog {
+// FileNetLogObserver is a simple implementation of NetLog::ThreadSafeObserver
+// that prints out all the events received into the stream passed
+// to the constructor.
+class FileNetLogObserver : public NetLog::ThreadSafeObserver {
public:
- explicit FileNetLog(FILE* destination, LogLevel level);
- virtual ~FileNetLog();
+ explicit FileNetLogObserver(FILE* destination);
+ virtual ~FileNetLogObserver();
- private:
- // NetLog implementation:
+ // NetLog::ThreadSafeObserver implementation:
virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
- virtual uint32 NextID() OVERRIDE;
- virtual LogLevel GetLogLevel() const OVERRIDE;
- virtual void AddThreadSafeObserver(ThreadSafeObserver* observer,
- LogLevel log_level) OVERRIDE;
- virtual void SetObserverLogLevel(ThreadSafeObserver* observer,
- LogLevel log_level) OVERRIDE;
- virtual void RemoveThreadSafeObserver(ThreadSafeObserver* observer) OVERRIDE;
-
- base::AtomicSequenceNumber sequence_number_;
- const NetLog::LogLevel log_level_;
+ private:
FILE* const destination_;
base::Lock lock_;
« no previous file with comments | « net/base/net_log_unittest.cc ('k') | net/tools/gdig/file_net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698