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

Side by Side Diff: remoting/host/vlog_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: private Observer 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 unified diff | Download patch
OLDNEW
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 "base/memory/scoped_ptr.h"
9 #include "net/base/net_log.h" 10 #include "net/base/net_log.h"
10 11
11 namespace remoting { 12 namespace remoting {
12 13
13 // Redirectes all networking events (i.e. events logged through net::NetLog) to 14 // 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 15 // 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 16 // passed to networking classes to receive the events. There is no global
16 // network events logger exists. 17 // network events logger exists.
17 class VlogNetLog : public net::NetLog { 18 class VlogNetLog : public net::NetLog {
18 public: 19 public:
19 VlogNetLog(); 20 VlogNetLog();
20 virtual ~VlogNetLog(); 21 virtual ~VlogNetLog();
21 22
22 // NetLog overrides:
23 virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE;
24 virtual uint32 NextID() OVERRIDE;
25 virtual LogLevel GetLogLevel() const OVERRIDE;
26 virtual void AddThreadSafeObserver(ThreadSafeObserver* observer,
27 LogLevel log_level) OVERRIDE;
28 virtual void SetObserverLogLevel(ThreadSafeObserver* observer,
29 LogLevel log_level) OVERRIDE;
30 virtual void RemoveThreadSafeObserver(ThreadSafeObserver* observer) OVERRIDE;
31
32 private: 23 private:
33 uint32 id_; 24 class Observer;
25 scoped_ptr<Observer> observer_;
34 26
35 DISALLOW_COPY_AND_ASSIGN(VlogNetLog); 27 DISALLOW_COPY_AND_ASSIGN(VlogNetLog);
36 }; 28 };
37 29
38 } // namespace remoting 30 } // namespace remoting
39 31
40 #endif // REMOTING_HOST_VLOG_NET_LOG_H_ 32 #endif // REMOTING_HOST_VLOG_NET_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698