Index: net/base/trace_net_log_observer.h |
diff --git a/net/base/trace_net_log_observer.h b/net/base/trace_net_log_observer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1b05e9084c0246e32abf996be9b409f07c92e5fb |
--- /dev/null |
+++ b/net/base/trace_net_log_observer.h |
@@ -0,0 +1,50 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef NET_BASE_TRACE_NET_LOG_OBSERVER_H_ |
+#define NET_BASE_TRACE_NET_LOG_OBSERVER_H_ |
+ |
+#include "base/debug/trace_event_impl.h" |
+#include "base/macros.h" |
+#include "net/base/net_export.h" |
+#include "net/base/net_log.h" |
+ |
+ |
mmenke
2014/08/21 15:35:40
nit: Remove above blank line.
xunjieli
2014/08/22 17:20:10
Done.
|
+namespace net { |
+ |
+class NET_EXPORT TraceNetLogObserver |
+ : public NetLog::ThreadSafeObserver, |
+ 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!
|
+ public: |
+ TraceNetLogObserver(); |
+ virtual ~TraceNetLogObserver(); |
+ |
+ void StartObserving(NetLog* net_log); |
+ |
+ // Stops observing net_log(). Must already be watching. |
+ 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!
|
+ |
+ // net::NetLog::ThreadSafeObserver implementation: |
+ virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE; |
+ |
+ void WatchForTraceStart(NetLog* net_log); |
+ |
+ void StopWatchForTraceStart(); |
+ |
+ // base::debug::TraceLog::EnabledStateChangedObserver implementation: |
+ virtual void OnTraceLogEnabled() OVERRIDE; |
+ virtual void OnTraceLogDisabled() OVERRIDE; |
+ |
+ private: |
+ // The LogLevel to log at. |
+ 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.
|
+ |
+ NetLog* net_log_to_watch_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TraceNetLogObserver); |
+}; |
+ |
+} // namespace net |
+ |
+#endif // NET_BASE_TRACE_NET_LOG_OBSERVER_H_ |