Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 NET_BASE_TRACE_NET_LOG_OBSERVER_H_ | |
| 6 #define NET_BASE_TRACE_NET_LOG_OBSERVER_H_ | |
| 7 | |
| 8 #include "base/debug/trace_event_impl.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "net/base/net_export.h" | |
| 11 #include "net/base/net_log.h" | |
| 12 | |
| 13 | |
|
mmenke
2014/08/21 15:35:40
nit: Remove above blank line.
xunjieli
2014/08/22 17:20:10
Done.
| |
| 14 namespace net { | |
| 15 | |
| 16 class NET_EXPORT TraceNetLogObserver | |
| 17 : public NetLog::ThreadSafeObserver, | |
| 18 public base::debug::TraceLog::EnabledStateObserver { | |
|
mmenke
2014/08/21 15:35:40
nit: Above two lines should be indented two more.
xunjieli
2014/08/22 17:20:10
Done. Thanks!
| |
| 19 public: | |
| 20 TraceNetLogObserver(); | |
| 21 virtual ~TraceNetLogObserver(); | |
| 22 | |
| 23 void StartObserving(NetLog* net_log); | |
| 24 | |
| 25 // Stops observing net_log(). Must already be watching. | |
| 26 void StopObserving(); | |
|
mmenke
2014/08/21 15:35:40
Neither of these two functions need to be public.
xunjieli
2014/08/22 17:20:10
Done. Thanks! Good idea!
| |
| 27 | |
| 28 // net::NetLog::ThreadSafeObserver implementation: | |
| 29 virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE; | |
| 30 | |
| 31 void WatchForTraceStart(NetLog* net_log); | |
| 32 | |
| 33 void StopWatchForTraceStart(); | |
| 34 | |
| 35 // base::debug::TraceLog::EnabledStateChangedObserver implementation: | |
| 36 virtual void OnTraceLogEnabled() OVERRIDE; | |
| 37 virtual void OnTraceLogDisabled() OVERRIDE; | |
| 38 | |
| 39 private: | |
| 40 // The LogLevel to log at. | |
| 41 NetLog::LogLevel log_level_; | |
|
mmenke
2014/08/21 15:35:40
Let's just get rid of this, for now, until we need
xunjieli
2014/08/22 17:20:10
Done.
| |
| 42 | |
| 43 NetLog* net_log_to_watch_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(TraceNetLogObserver); | |
| 46 }; | |
| 47 | |
| 48 } // namespace net | |
| 49 | |
| 50 #endif // NET_BASE_TRACE_NET_LOG_OBSERVER_H_ | |
| OLD | NEW |