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

Side by Side Diff: net/base/trace_net_log_observer.h

Issue 468083004: Use NESTABLE_ASYNC APIs to get NetLog data into Tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Filtered trace events in unittests Created 6 years, 3 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
(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 namespace net {
14
15 // TraceNetLogObserver watches for Trace enable, and sends NetLog
mmenke 2014/09/03 19:12:10 nit: "Trace enable" -> "trace enable" or "TraceLo
xunjieli 2014/09/08 14:08:41 Done.
16 // events to TraceLog if it is enabled.
17 class NET_EXPORT TraceNetLogObserver
18 : public NetLog::ThreadSafeObserver,
19 public base::debug::TraceLog::EnabledStateObserver {
mmenke 2014/09/03 19:12:10 Per email comment, EnabledStateObserver is not dec
xunjieli 2014/09/08 14:08:41 Acknowledged. The deadlock problem has been fixed
20 public:
21 TraceNetLogObserver();
22 virtual ~TraceNetLogObserver();
23
24 // net::NetLog::ThreadSafeObserver implementation:
25 virtual void OnAddEntry(const NetLog::Entry& entry) OVERRIDE;
26
27 // Start to watch for TraceLog enable and disable events.
28 // This can't be called if already watching for events.
29 // Watches NetLog only when tracing is enabled.
30 void WatchForTraceStart(NetLog* net_log);
31
32 // Stop watching for TraceLog enable and disable events.
33 // If WatchForTraceStart is called, this must be called before
34 // TraceNetLogObserver is destroyed.
35 void StopWatchForTraceStart();
36
37 // base::debug::TraceLog::EnabledStateChangedObserver implementation:
38 virtual void OnTraceLogEnabled() OVERRIDE;
39 virtual void OnTraceLogDisabled() OVERRIDE;
40
41 private:
42 NetLog* net_log_to_watch_;
43
44 DISALLOW_COPY_AND_ASSIGN(TraceNetLogObserver);
45 };
46
47 } // namespace net
48
49 #endif // NET_BASE_TRACE_NET_LOG_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698