| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_HOST_VLOG_NET_LOG_H_ | 5 #ifndef REMOTING_HOST_VLOG_NET_LOG_H_ |
| 6 #define REMOTING_HOST_VLOG_NET_LOG_H_ | 6 #define REMOTING_HOST_VLOG_NET_LOG_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_handle.h" | 8 #include "base/memory/scoped_handle.h" |
| 9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
| 10 | 10 |
| 11 namespace remoting { | 11 namespace remoting { |
| 12 | 12 |
| 13 // Redirectes all networking events (i.e. events logged through net::NetLog) to | 13 // Redirectes all networking events (i.e. events logged through net::NetLog) to |
| 14 // VLOG(4). Note that an explicit reference to a net::NetLog object has to be | 14 // VLOG(4). Note that an explicit reference to a net::NetLog object has to be |
| 15 // passed to networking classes to receive the events. There is no global | 15 // passed to networking classes to receive the events. There is no global |
| 16 // network events logger exists. | 16 // network events logger exists. |
| 17 class VlogNetLog : public net::NetLog { | 17 class VlogNetLog : public net::NetLog { |
| 18 public: | 18 public: |
| 19 VlogNetLog(); | 19 VlogNetLog(); |
| 20 virtual ~VlogNetLog(); | 20 virtual ~VlogNetLog(); |
| 21 | 21 |
| 22 // NetLog overrides: | 22 // NetLog overrides: |
| 23 virtual void AddEntry( | 23 virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE; |
| 24 EventType type, | |
| 25 const Source& source, | |
| 26 EventPhase phase, | |
| 27 const scoped_refptr<NetLog::EventParameters>& params) OVERRIDE; | |
| 28 virtual uint32 NextID() OVERRIDE; | 24 virtual uint32 NextID() OVERRIDE; |
| 29 virtual LogLevel GetLogLevel() const OVERRIDE; | 25 virtual LogLevel GetLogLevel() const OVERRIDE; |
| 30 virtual void AddThreadSafeObserver(ThreadSafeObserver* observer, | 26 virtual void AddThreadSafeObserver(ThreadSafeObserver* observer, |
| 31 LogLevel log_level) OVERRIDE; | 27 LogLevel log_level) OVERRIDE; |
| 32 virtual void SetObserverLogLevel(ThreadSafeObserver* observer, | 28 virtual void SetObserverLogLevel(ThreadSafeObserver* observer, |
| 33 LogLevel log_level) OVERRIDE; | 29 LogLevel log_level) OVERRIDE; |
| 34 virtual void RemoveThreadSafeObserver(ThreadSafeObserver* observer) OVERRIDE; | 30 virtual void RemoveThreadSafeObserver(ThreadSafeObserver* observer) OVERRIDE; |
| 35 | 31 |
| 36 private: | 32 private: |
| 37 uint32 id_; | 33 uint32 id_; |
| 38 | 34 |
| 39 DISALLOW_COPY_AND_ASSIGN(VlogNetLog); | 35 DISALLOW_COPY_AND_ASSIGN(VlogNetLog); |
| 40 }; | 36 }; |
| 41 | 37 |
| 42 } // namespace remoting | 38 } // namespace remoting |
| 43 | 39 |
| 44 #endif // REMOTING_HOST_VLOG_NET_LOG_H_ | 40 #endif // REMOTING_HOST_VLOG_NET_LOG_H_ |
| OLD | NEW |